[Zodb-checkins] CVS: ZODB3/ZODB - FileStorage.py:1.128

Jeremy Hylton jeremy@zope.com
Mon, 17 Mar 2003 13:52:50 -0500


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

Modified Files:
	FileStorage.py 
Log Message:
Fix one NameError and add grumbly comment about try/except that masked it.


=== ZODB3/ZODB/FileStorage.py 1.127 => 1.128 ===
--- ZODB3/ZODB/FileStorage.py:1.127	Fri Feb 28 14:50:59 2003
+++ ZODB3/ZODB/FileStorage.py	Mon Mar 17 13:52:50 2003
@@ -604,14 +604,15 @@
         h=read(DATA_HDR_LEN)
         doid,serial,prev,tloc,vlen,plen = unpack(DATA_HDR, h)
         if vlen:
-            assert read(8) != z64
+            nv = u64(read(8))
             read(8) # Skip previous version record pointer
-            version=read(vlen)
+            version = read(vlen)
         else:
-            version=''
-            nv=0
+            version = ''
+            nv = 0
 
-        if plen != z64: return read(u64(plen)), version, nv
+        if plen != z64:
+            return read(u64(plen)), version, nv
         return _loadBack(file, oid, read(8))[0], version, nv
 
     def _load(self, oid, version, _index, file):
@@ -1497,6 +1498,8 @@
                 except:
                     pindex[oid]=0
                     error('Bad reference to %s', `(oid,v)`)
+                    # XXX This try/except frequently masks bugs in the
+                    # implementation.
 
             ##################################################################
             # Step 2, copy data and compute new index based on new positions.
@@ -2348,6 +2351,7 @@
             seek(pos)
             h=read(TRANS_HDR_LEN)
             if len(h) < TRANS_HDR_LEN: break
+
 
             tid, stl, status, ul, dl, el = unpack(TRANS_HDR,h)
             if el < 0: el=t32-el