Commit dd9478b7 authored by Jim Fulton's avatar Jim Fulton

Fixed various name errors

(Thanks to Patrick Strawderman for pointing these out and providing
initial fixes.)
parent 96d71fe4
......@@ -272,6 +272,9 @@ class InvalidationTests:
# the actual database state.
expected_keys = []
errormsgs = []
err = errormsgs.append
for t in threads:
if not t.added_keys:
err("thread %d didn't add any keys" % t.threadnum)
......@@ -285,8 +288,6 @@ class InvalidationTests:
break
time.sleep(.1)
else:
errormsgs = []
err = errormsgs.append
err("expected keys != actual keys")
for k in expected_keys:
if k not in actual_keys:
......
......@@ -46,6 +46,8 @@ from ZODB.tests.testDemoStorage import DemoStorageWrappedBase
from ZEO.ClientStorage import ClientStorage
from ZEO.zrpc.error import DisconnectedError
import ZEO.zrpc.connection
from ZEO.tests import forker, Cache, CommitLockTests, ThreadTests, \
......
......@@ -152,6 +152,9 @@ else:
# Windows version; uses just sockets, because a pipe isn't select'able
# on Windows.
class BindError(Exception):
pass
class trigger(_triggerbase, asyncore.dispatcher):
kind = "loopback"
......
......@@ -32,6 +32,13 @@ from ZODB.utils import p64, u64, z64
from ZODB.fsIndex import fsIndex
from ZODB.FileStorage.format import FileStorageFormatter, CorruptedDataError
from ZODB.FileStorage.format import DataHeader, TRANS_HDR_LEN
import ZODB.POSException
import logging
logger = logging.getLogger(__name__)
class PackError(ZODB.POSException.POSError):
pass
class PackCopier(FileStorageFormatter):
......@@ -55,7 +62,7 @@ class PackCopier(FileStorageFormatter):
if stop_at_pack:
if h[16] == 'p':
break
raise UndoError(None, "Invalid transaction id")
raise PackError("Invalid backpointer transaction id")
def _data_find(self, tpos, oid, data):
# Return backpointer for oid. Must call with the lock held.
......@@ -84,7 +91,8 @@ class PackCopier(FileStorageFormatter):
if h.plen != len(data):
# The expected data doesn't match what's in the
# backpointer. Something is wrong.
error("Mismatch between data and backpointer at %d", pos)
logger.error("Mismatch between data and backpointer at %d",
pos)
return 0
_data = self._file.read(h.plen)
if data != _data:
......
......@@ -134,6 +134,7 @@ def main(path=None):
classes = {} # class -> list of oids
MAX = 0
objects = 0
tid = None
f = open(path, "rb")
......
......@@ -99,6 +99,9 @@ def Main():
import sys
import getopt
global PACK
global VERBOSE
PACK = 0
VERBOSE = 0
try:
......
......@@ -101,7 +101,7 @@ def main():
elif o == '-X':
heuristic = True
else:
assert False, (o, opt)
assert False, (o, opts)
if len(args) != 1:
usage("exactly one file argument required")
......
......@@ -356,7 +356,7 @@ def checkIncreasingTids(fs):
lasttid = '\0' * 8
for txn in fs.iterator():
if lasttid >= txn.tid:
raise ValueError("tids out of order %r >= %r" % (lasttid, tid))
raise ValueError("tids out of order %r >= %r" % (lasttid, txn.tid))
lasttid = txn.tid
# Return a TimeStamp object 'minutes' minutes in the future.
......
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