[Zope-Checkins] CVS: ZODB3/ZODB - FileStorage.py:1.135.6.4

Tim Peters tim.one at comcast.net
Thu Jun 17 13:37:36 EDT 2004


Update of /cvs-repository/ZODB3/ZODB
In directory cvs.zope.org:/tmp/cvs-serv8234/ZODB

Modified Files:
      Tag: Zope-2_7-branch
	FileStorage.py 
Log Message:
_data_find():  Repaired confusing (ungrammatical) and incorrect comments.
Added XXX about error behavior that doesn't appear to make sense.


=== ZODB3/ZODB/FileStorage.py 1.135.6.3 => 1.135.6.4 ===
--- ZODB3/ZODB/FileStorage.py:1.135.6.3	Mon Sep 15 17:26:56 2003
+++ ZODB3/ZODB/FileStorage.py	Thu Jun 17 13:37:34 2004
@@ -822,9 +822,18 @@
             self._lock_release()
 
     def _data_find(self, tpos, oid, data):
-        # Return backpointer to oid in data record for in transaction at tpos.
-        # It should contain a pickle identical to data. Returns 0 on failure.
-        # Must call with lock held.
+        # Return backpointer for oid.  Must call with the lock held.
+        # This is a file offset to oid's data record if found, else 0.
+        # The data records in the transaction at tpos are searched for oid.
+        # If a data record for oid isn't found, returns 0.
+        # Else if oid's data record contains a backpointer, that
+        # backpointer is returned.
+        # Else oid's data record contains the data, and the file offset of
+        # oid's data record is returned.  This data record should contain
+        # a pickle identical to the 'data' argument.
+        # XXX If the length of the stored data doesn't match len(data),
+        # XXX an exception is raised.  If the lengths match but the data
+        # XXX isn't the same, 0 is returned.  Why the discrepancy?
         self._file.seek(tpos)
         h = self._file.read(TRANS_HDR_LEN)
         tid, stl, status, ul, dl, el = struct.unpack(TRANS_HDR, h)




More information about the Zope-Checkins mailing list