[Zodb-checkins] SVN: ZODB/trunk/src/ Fixed bug in transaction buffer: a tuple was unpacked incorrectly in .

Thomas Lotze tl at gocept.com
Tue Jan 29 04:01:23 EST 2008


Log message for revision 83288:
  Fixed bug in transaction buffer: a tuple was unpacked incorrectly in .

Changed:
  U   ZODB/trunk/src/CHANGES.txt
  U   ZODB/trunk/src/ZEO/TransactionBuffer.py
  U   ZODB/trunk/src/ZEO/tests/testZEO.py

-=-
Modified: ZODB/trunk/src/CHANGES.txt
===================================================================
--- ZODB/trunk/src/CHANGES.txt	2008-01-29 04:09:32 UTC (rev 83287)
+++ ZODB/trunk/src/CHANGES.txt	2008-01-29 09:01:21 UTC (rev 83288)
@@ -35,6 +35,9 @@
 Bugs Fixed
 ----------
 
+- Fixed bug in transaction buffer: a tuple was unpacked incorrectly in
+  `clear`.
+
 - Bugfix the situation in which comparing persistent objects (for
   instance, as members in BTree set or keys of BTree) might cause data
   inconsistency during conflict resolution.

Modified: ZODB/trunk/src/ZEO/TransactionBuffer.py
===================================================================
--- ZODB/trunk/src/ZEO/TransactionBuffer.py	2008-01-29 04:09:32 UTC (rev 83287)
+++ ZODB/trunk/src/ZEO/TransactionBuffer.py	2008-01-29 09:01:21 UTC (rev 83288)
@@ -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
@@ -113,7 +114,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/trunk/src/ZEO/tests/testZEO.py
===================================================================
--- ZODB/trunk/src/ZEO/tests/testZEO.py	2008-01-29 04:09:32 UTC (rev 83287)
+++ ZODB/trunk/src/ZEO/tests/testZEO.py	2008-01-29 09:01:21 UTC (rev 83288)
@@ -547,6 +547,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