Commit 60ee1e69 authored by Jeremy Hylton's avatar Jeremy Hylton

Fix one NameError and add grumbly comment about try/except that masked it.

parent 23472c22
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
# may have a back pointer to a version record or to a non-version # may have a back pointer to a version record or to a non-version
# record. # record.
# #
__version__='$Revision: 1.127 $'[11:-2] __version__='$Revision: 1.128 $'[11:-2]
import base64 import base64
from cPickle import Pickler, Unpickler, loads from cPickle import Pickler, Unpickler, loads
...@@ -604,14 +604,15 @@ class FileStorage(BaseStorage.BaseStorage, ...@@ -604,14 +604,15 @@ class FileStorage(BaseStorage.BaseStorage,
h=read(DATA_HDR_LEN) h=read(DATA_HDR_LEN)
doid,serial,prev,tloc,vlen,plen = unpack(DATA_HDR, h) doid,serial,prev,tloc,vlen,plen = unpack(DATA_HDR, h)
if vlen: if vlen:
assert read(8) != z64 nv = u64(read(8))
read(8) # Skip previous version record pointer read(8) # Skip previous version record pointer
version=read(vlen) version = read(vlen)
else: else:
version='' version = ''
nv=0 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 return _loadBack(file, oid, read(8))[0], version, nv
def _load(self, oid, version, _index, file): def _load(self, oid, version, _index, file):
...@@ -1497,6 +1498,8 @@ class FileStorage(BaseStorage.BaseStorage, ...@@ -1497,6 +1498,8 @@ class FileStorage(BaseStorage.BaseStorage,
except: except:
pindex[oid]=0 pindex[oid]=0
error('Bad reference to %s', `(oid,v)`) 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. # Step 2, copy data and compute new index based on new positions.
...@@ -2349,6 +2352,7 @@ class FileIterator(Iterator): ...@@ -2349,6 +2352,7 @@ class FileIterator(Iterator):
h=read(TRANS_HDR_LEN) h=read(TRANS_HDR_LEN)
if len(h) < TRANS_HDR_LEN: break if len(h) < TRANS_HDR_LEN: break
tid, stl, status, ul, dl, el = unpack(TRANS_HDR,h) tid, stl, status, ul, dl, el = unpack(TRANS_HDR,h)
if el < 0: el=t32-el if el < 0: el=t32-el
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment