[Zodb-checkins] SVN: ZODB/branches/blob-merge-branch/src/Z Windows compatibility: Deleting or renaming files fails if they are still open,

Wolfgang Schnerring wosc at wosc.de
Mon Sep 25 04:54:10 EDT 2006


Log message for revision 70359:
  Windows compatibility: Deleting or renaming files fails if they are still open,
  so close them before you do something to them.
  

Changed:
  U   ZODB/branches/blob-merge-branch/src/ZEO/ClientStorage.py
  U   ZODB/branches/blob-merge-branch/src/ZEO/tests/testZEO.py
  U   ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/basic.txt

-=-
Modified: ZODB/branches/blob-merge-branch/src/ZEO/ClientStorage.py
===================================================================
--- ZODB/branches/blob-merge-branch/src/ZEO/ClientStorage.py	2006-09-24 22:34:09 UTC (rev 70358)
+++ ZODB/branches/blob-merge-branch/src/ZEO/ClientStorage.py	2006-09-25 08:54:07 UTC (rev 70359)
@@ -921,6 +921,7 @@
             if not chunk:
                 self._server.storeBlobEnd(oid, serial, data, version, id(txn))
                 break
+        blobfile.close()
         os.unlink(blobfilename)
         return serials
 

Modified: ZODB/branches/blob-merge-branch/src/ZEO/tests/testZEO.py
===================================================================
--- ZODB/branches/blob-merge-branch/src/ZEO/tests/testZEO.py	2006-09-24 22:34:09 UTC (rev 70358)
+++ ZODB/branches/blob-merge-branch/src/ZEO/tests/testZEO.py	2006-09-25 08:54:07 UTC (rev 70359)
@@ -207,9 +207,8 @@
         super(BlobAdaptedFileStorageTests, self).setUp()
         
     def tearDown(self):
-        shutil.rmtree(self.blobdir)
-        os.unlink(self.filestorage)
         super(BlobAdaptedFileStorageTests, self).tearDown()
+        shutil.rmtree(self.blobdir)
 
     def getConfig(self):
         return """

Modified: ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/basic.txt
===================================================================
--- ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/basic.txt	2006-09-24 22:34:09 UTC (rev 70358)
+++ ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/basic.txt	2006-09-25 08:54:07 UTC (rev 70359)
@@ -157,6 +157,7 @@
     >>> f = myblob.open('w')
     >>> len(os.listdir(tempdir))
     1
+    >>> f.close()
     >>> shutil.rmtree(tempdir)
     >>> del os.environ['ZODB_BLOB_TEMPDIR']
 



More information about the Zodb-checkins mailing list