Skip to content

Instantly share code, notes, and snippets.

@bbrowning
Created May 24, 2009 03:06
Show Gist options
  • Save bbrowning/116931 to your computer and use it in GitHub Desktop.
Save bbrowning/116931 to your computer and use it in GitHub Desktop.
--- file_manager_orig.py 2009-05-23 23:01:26.000000000 -0400
+++ file_manager.py 2009-05-21 19:03:01.000000000 -0400
@@ -639,7 +639,7 @@ class FileManager(object):
name = os.path.join('vendor/%s' % vendor, name)
signature = sign_file(file_path)
_signatures[name] = signature
- _attachments[name] = open(file_path, 'rb')
+ _attachments[name] = file_path
# detect attachments to be removed and keep
# only new version attachments to update.
@@ -671,9 +671,10 @@ class FileManager(object):
if verbose >= 2:
print "Attaching %s" % filename
+ f = open(value, 'rb')
# fix issue with httplib that raises BadStatusLine
# error because it didn't close the connection
- self._put_attachment(db, design, value, filename)
+ self._put_attachment(db, design, f, filename)
# update signatures
design = db[docid]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment