[Zodb-checkins] SVN: ZODB/branches/3.8/ Fixed bug in transaction buffer: a tuple was unpackged incorrectly in `clear`.

Christian Theune ct at gocept.com
Tue Jan 29 12:15:17 EST 2008


Log message for revision 83301:
  Fixed bug in transaction buffer: a tuple was unpackged incorrectly in `clear`.
  (backport from trunk)
  

Changed:
  U   ZODB/branches/3.8/NEWS.txt
  U   ZODB/branches/3.8/src/ZEO/TransactionBuffer.py
  U   ZODB/branches/3.8/src/ZEO/tests/testZEO.py

-=-
Modified: ZODB/branches/3.8/NEWS.txt
===================================================================
--- ZODB/branches/3.8/NEWS.txt	2008-01-29 15:32:29 UTC (rev 83300)
+++ ZODB/branches/3.8/NEWS.txt	2008-01-29 17:15:16 UTC (rev 83301)
@@ -33,6 +33,9 @@
 ZEO
 ---
 
+- (???) Fixed bug in transaction buffer: a tuple was unpackged incorrectly in
+  `clear`.
+
 - (???) Fixed bug in blob filesystem helper: the `isSecure` check was inversed.
 
 - (3.8.0b6) Bug #98275: Made ZEO cache more tolerant when invalidating current

Modified: ZODB/branches/3.8/src/ZEO/TransactionBuffer.py
===================================================================
--- ZODB/branches/3.8/src/ZEO/TransactionBuffer.py	2008-01-29 15:32:29 UTC (rev 83300)
+++ ZODB/branches/3.8/src/ZEO/TransactionBuffer.py	2008-01-29 17:15:16 UTC (rev 83301)
@@ -21,6 +21,7 @@
 # A faster implementation might store trans data in memory until it
 # reaches a certain size.
 
+import os
 import cPickle
 import tempfile
 from threading import Lock
@@ -119,7 +120,7 @@
             self.count = 0
             self.size = 0
             while self.blobs:
-                oid, serial, blobfilename = self.blobs.pop()
+                oid, blobfilename = self.blobs.pop()
                 if os.path.exists(blobfilename):
                     os.remove(blobfilename)
         finally:

Modified: ZODB/branches/3.8/src/ZEO/tests/testZEO.py
===================================================================
--- ZODB/branches/3.8/src/ZEO/tests/testZEO.py	2008-01-29 15:32:29 UTC (rev 83300)
+++ ZODB/branches/3.8/src/ZEO/tests/testZEO.py	2008-01-29 17:15:16 UTC (rev 83301)
@@ -568,6 +568,17 @@
         self.assertEquals(self.blob_cache_dir,
                           self._storage.temporaryDirectory())
 
+    def checkTransactionBufferCleanup(self):
+        oid = self._storage.new_oid()
+        handle, blob_file_name = tempfile.mkstemp() #XXX cleanup temp file
+        open(blob_file_name, 'w').write('I am a happy blob.')
+        t = transaction.Transaction()
+        self._storage.tpc_begin(t)
+        self._storage.storeBlob(
+          oid, ZODB.utils.z64, 'foo', blob_file_name, '', t)
+        self._storage.close()
+
+
 class BlobAdaptedFileStorageTests(GenericTests, CommonBlobTests):
     """ZEO backed by a BlobStorage-adapted FileStorage."""
 



More information about the Zodb-checkins mailing list