[Zope-Checkins] CVS: ZODB3/ZODB/FileStorage - format.py:1.1.2.4
FileStorage.py:1.1.2.7
Jeremy Hylton
cvs-admin at zope.org
Wed Nov 12 00:23:49 EST 2003
Update of /cvs-repository/ZODB3/ZODB/FileStorage
In directory cvs.zope.org:/tmp/cvs-serv5161
Modified Files:
Tag: ZODB3-mvcc-2-branch
format.py FileStorage.py
Log Message:
Remove unused local variables.
One case was an apparent bug where pv was assigned to instead of
vprev. XXX Should have a test that covers this case.
=== ZODB3/ZODB/FileStorage/format.py 1.1.2.3 => 1.1.2.4 ===
--- ZODB3/ZODB/FileStorage/format.py:1.1.2.3 Thu Oct 9 16:26:23 2003
+++ ZODB3/ZODB/FileStorage/format.py Wed Nov 12 00:23:49 2003
@@ -260,7 +260,6 @@
"txnlen (%d) < headerlen(%d)", th.tlen, th.headerlen())
def checkData(self, th, tpos, dh, pos):
- tend = tpos + th.tlen
if dh.tloc != tpos:
self.fail(pos, "data record does not point to transaction header"
": %d != %d", dh.tloc, tpos)
=== ZODB3/ZODB/FileStorage/FileStorage.py 1.1.2.6 => 1.1.2.7 ===
--- ZODB3/ZODB/FileStorage/FileStorage.py:1.1.2.6 Tue Nov 11 22:45:45 2003
+++ ZODB3/ZODB/FileStorage/FileStorage.py Wed Nov 12 00:23:49 2003
@@ -405,8 +405,9 @@
try:
self._save_index()
except:
- # XXX should log the error, though
- pass # We don't care if this fails.
+ # Log the error and continue
+ LOG("ZODB FS", ERROR, "Error saving index on close()",
+ error=sys.exc_info())
# Return serial number of most recent record for oid if that's in
# the _oid2serial cache. Else return None. It's important to use
@@ -480,8 +481,6 @@
here = self._pos + (self._tfile.tell() + self._thl)
oids = []
current_oids = {}
- t = None
- tstatus = ' '
if not abort:
newserial = self._serial
@@ -754,7 +753,7 @@
pnv = self._restore_pnv(oid, old, version, prev_pos) or old
vprev = self._tvindex.get(version, 0)
if not vprev:
- pv = self._vindex.get(version, 0)
+ vprev = self._vindex.get(version, 0)
new.setVersion(version, pnv, vprev)
self._tvindex[version] = here
self._toid2serial_delete[oid] = 1
@@ -1321,7 +1320,7 @@
if os.path.exists(oldpath):
os.remove(oldpath)
os.rename(self._file_name, oldpath)
- except Exception, msg:
+ except Exception:
self._file = open(self._file_name, 'r+b')
raise
@@ -1706,8 +1705,7 @@
doid, serial, prev, tloc, vlen, plen = unpack(DATA_HDR, h)
if vlen:
- file.read(16)
- version = file.read(vlen)
+ file.read(16 + vlen)
if plen != z64:
return file.read(u64(plen)), serial, old, tloc
back = file.read(8) # We got a back pointer!
More information about the Zope-Checkins
mailing list