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