]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
offloaded: close reader before removing its file
authorrobk-tahoe <robk-tahoe@allmydata.com>
Fri, 18 Jan 2008 00:36:28 +0000 (17:36 -0700)
committerrobk-tahoe <robk-tahoe@allmydata.com>
Fri, 18 Jan 2008 00:36:28 +0000 (17:36 -0700)
unlinking a file before closing it is not portable. it works on unix, but fails
since an open file holds a lock on windows.

this closes the reader before trying to unlink the encoding file within the
CHKUploadHelper.

src/allmydata/offloaded.py

index 9f1966c16c454391e26d3ff5e0f650b328419d40..66b7fbc7c8be0712a29f2dbb618f4f141bf6246e 100644 (file)
@@ -92,6 +92,7 @@ class CHKUploadHelper(Referenceable, upload.CHKUploader):
     def _finished(self, res):
         (uri_extension_hash, needed_shares, total_shares, size) = res
         upload_results = {'uri_extension_hash': uri_extension_hash}
+        self._reader.close()
         os.unlink(self._encoding_file)
         self._finished_observers.fire(upload_results)
         self._helper.upload_finished(self._storage_index)