[Checkins] SVN: zc.FileStorage/dev/src/zc/FileStorage/__init__.py Fixed bug: failed to do the last pack step. It's weird that tests

Jim Fulton jim at zope.com
Wed Dec 5 17:42:41 EST 2007


Log message for revision 82149:
  Fixed bug: failed to do the last pack step. It's weird that tests
  passed on my (athalon xp) machine at home, but failed on my P4 and VM
  here.
  

Changed:
  U   zc.FileStorage/dev/src/zc/FileStorage/__init__.py

-=-
Modified: zc.FileStorage/dev/src/zc/FileStorage/__init__.py
===================================================================
--- zc.FileStorage/dev/src/zc/FileStorage/__init__.py	2007-12-05 22:27:03 UTC (rev 82148)
+++ zc.FileStorage/dev/src/zc/FileStorage/__init__.py	2007-12-05 22:42:41 UTC (rev 82149)
@@ -30,9 +30,9 @@
     This is to try to avoid gobs of system calls.
     """
 
-    def seek(self, pos):
+    def seek(self, pos, whence=0):
         if pos != self.tell():
-            file.seek(self, pos)
+            file.seek(self, pos, whence)
     
 
 class FileStoragePacker(FileStorageFormatter):
@@ -83,7 +83,8 @@
             os.remove(self._name + ".pack")
             return None
 
-        new_pos = self.copyFromPacktime(packpos, self.file_end, output, index)
+        input_pos = self.copyFromPacktime(packpos, self.file_end, output, index)
+        self.copyRest(input_pos, output, index)
 
         # OK, we've copied everything. Now we need to wrap things up.
         pos = output.tell()
@@ -305,6 +306,7 @@
     def copyFromPacktime(self, input_pos, file_end, output, index):
         while input_pos < file_end:
             input_pos = self._copyNewTrans(input_pos, output, index)
+        return input_pos
 
     def copyRest(self, input_pos, output, index):
         # Copy data records written since packing started.



More information about the Checkins mailing list