summaryrefslogtreecommitdiff
path: root/src/leap/soledad/server
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-09-11 18:24:06 -0300
committerVictor Shyba <victor1984@riseup.net>2017-09-11 18:24:06 -0300
commit855ab772a800c522cca58e67140f833fa7815034 (patch)
tree27fe5513224ab9a756e521cba733a09c8acad8ff /src/leap/soledad/server
parent0d7bf3133c0d64ef3d52f33cb21fb8e76a3ac69d (diff)
[bug] close consumer on FileBodyProducer
It isn't closed by Twisted like the producer is. -- Resolves: #8924 -- Related: #8932
Diffstat (limited to 'src/leap/soledad/server')
-rw-r--r--src/leap/soledad/server/_blobs.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/leap/soledad/server/_blobs.py b/src/leap/soledad/server/_blobs.py
index f7db9218..790a9b51 100644
--- a/src/leap/soledad/server/_blobs.py
+++ b/src/leap/soledad/server/_blobs.py
@@ -121,7 +121,8 @@ class FilesystemBlobsBackend(object):
defer.returnValue(None)
logger.info('writing blob: %s - %s' % (user, blob_id))
fbp = FileBodyProducer(request.content)
- yield fbp.startProducing(open(path, 'wb'))
+ with open(path, 'wb') as blobfile:
+ yield fbp.startProducing(blobfile)
def delete_blob(self, user, blob_id, namespace=''):
blob_path = self._get_path(user, blob_id, namespace)