[Zodb-checkins] CVS: ZODB3/Tools - repozo.py:22.214.171.124
tim.one at comcast.net
Sat Aug 16 20:25:05 EDT 2003
Update of /cvs-repository/ZODB3/Tools
In directory cvs.zope.org:/tmp/cvs-serv10446/Tools
scandat(): The caller clearly believes that (None,)*4 should be returned
if the .dat file is missing or empty. However, the code actually tries to
do long(None) in either of those cases, and that leads to the traceback
death Jens reported. Repaired that in the obvious way, but this is
Also repaired out-of-date and inaccurate comments in scandat().
=== ZODB3/Tools/repozo.py 126.96.36.199 => 188.8.131.52 ===
--- ZODB3/Tools/repozo.py:184.108.40.206 Mon Apr 7 17:54:56 2003
+++ ZODB3/Tools/repozo.py Sat Aug 16 19:24:59 2003
@@ -296,15 +296,20 @@
log('no files found')
+# Scan the .dat file corresponding to the last full backup performed.
+# filename, startpos, endpos, checksum
+# of the last incremental. If there is no .dat file, or the .dat file
+# is empty, return
+# None, None, None, None
- # Scan the .dat file corresponding to the last full backup performed.
- # Return the filename, startpos, endpos, and sum of the last incremental.
- # If all is a list, then append file name and md5sums to the list.
fullfile = repofiles
datfile = os.path.splitext(fullfile) + '.dat'
- # If the .dat file is missing, we have to do a full backup
- fn = startpos = endpos = sum = None
+ fn = startpos = endpos = sum = None # assume .dat file missing or empty
fp = open(datfile)
except IOError, e:
@@ -315,11 +320,11 @@
line = fp.readline()
if not line:
- # We only care about the last one
+ # We only care about the last one.
fn, startpos, endpos, sum = line.split()
- startpos = long(startpos)
- endpos = long(endpos)
+ startpos = long(startpos)
+ endpos = long(endpos)
return fn, startpos, endpos, sum
More information about the Zodb-checkins