[Zodb-checkins] SVN: ZODB/branches/patrick-pyflakes/src/Z Undefined names/missing imports
Patrick Strawderman
patrick at zope.com
Tue Nov 18 21:15:38 EST 2008
Log message for revision 93123:
Undefined names/missing imports
Changed:
U ZODB/branches/patrick-pyflakes/src/ZEO/ClientStorage.py
U ZODB/branches/patrick-pyflakes/src/ZEO/DebugServer.py
U ZODB/branches/patrick-pyflakes/src/ZEO/cache.py
U ZODB/branches/patrick-pyflakes/src/ZEO/tests/InvalidationTests.py
U ZODB/branches/patrick-pyflakes/src/ZEO/tests/testZEO.py
U ZODB/branches/patrick-pyflakes/src/ZEO/zrpc/trigger.py
U ZODB/branches/patrick-pyflakes/src/ZODB/FileStorage/fspack.py
U ZODB/branches/patrick-pyflakes/src/ZODB/scripts/fsstats.py
U ZODB/branches/patrick-pyflakes/src/ZODB/scripts/netspace.py
U ZODB/branches/patrick-pyflakes/src/ZODB/scripts/stats.py
U ZODB/branches/patrick-pyflakes/src/ZODB/tests/testFileStorage.py
-=-
Modified: ZODB/branches/patrick-pyflakes/src/ZEO/ClientStorage.py
===================================================================
--- ZODB/branches/patrick-pyflakes/src/ZEO/ClientStorage.py 2008-11-19 01:45:11 UTC (rev 93122)
+++ ZODB/branches/patrick-pyflakes/src/ZEO/ClientStorage.py 2008-11-19 02:15:37 UTC (rev 93123)
@@ -1245,9 +1245,10 @@
self.finish_verification()
return "no verification"
elif ltid < last_inval_tid:
- logger.critical(
+ message = (
"%s Client has seen newer transactions than server!",
self.__name__)
+ logger.critical(message)
raise ClientStorageError(message)
# log some hints about last transaction
Modified: ZODB/branches/patrick-pyflakes/src/ZEO/DebugServer.py
===================================================================
--- ZODB/branches/patrick-pyflakes/src/ZEO/DebugServer.py 2008-11-19 01:45:11 UTC (rev 93122)
+++ ZODB/branches/patrick-pyflakes/src/ZEO/DebugServer.py 2008-11-19 02:15:37 UTC (rev 93123)
@@ -13,6 +13,7 @@
##############################################################################
"""A debugging version of the server that records network activity."""
+from errno import ECONNRESET, ENOTCONN, ESHUTDOWN
import struct
import time
import socket
Modified: ZODB/branches/patrick-pyflakes/src/ZEO/cache.py
===================================================================
--- ZODB/branches/patrick-pyflakes/src/ZEO/cache.py 2008-11-19 01:45:11 UTC (rev 93122)
+++ ZODB/branches/patrick-pyflakes/src/ZEO/cache.py 2008-11-19 02:15:37 UTC (rev 93123)
@@ -235,7 +235,8 @@
seek = f.seek
write = f.write
seek(0)
- if read(4) != magic:
+ _magic = read(4)
+ if _magic != magic:
raise ValueError("unexpected magic number: %r" % _magic)
self.tid = read(8)
if len(self.tid) != 8:
Modified: ZODB/branches/patrick-pyflakes/src/ZEO/tests/InvalidationTests.py
===================================================================
--- ZODB/branches/patrick-pyflakes/src/ZEO/tests/InvalidationTests.py 2008-11-19 01:45:11 UTC (rev 93122)
+++ ZODB/branches/patrick-pyflakes/src/ZEO/tests/InvalidationTests.py 2008-11-19 02:15:37 UTC (rev 93123)
@@ -272,6 +272,9 @@
# 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 @@
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:
Modified: ZODB/branches/patrick-pyflakes/src/ZEO/tests/testZEO.py
===================================================================
--- ZODB/branches/patrick-pyflakes/src/ZEO/tests/testZEO.py 2008-11-19 01:45:11 UTC (rev 93122)
+++ ZODB/branches/patrick-pyflakes/src/ZEO/tests/testZEO.py 2008-11-19 02:15:37 UTC (rev 93123)
@@ -46,6 +46,8 @@
from ZEO.ClientStorage import ClientStorage
+from ZEO.zrpc.error import DisconnectedError
+
import ZEO.zrpc.connection
from ZEO.tests import forker, Cache, CommitLockTests, ThreadTests, \
Modified: ZODB/branches/patrick-pyflakes/src/ZEO/zrpc/trigger.py
===================================================================
--- ZODB/branches/patrick-pyflakes/src/ZEO/zrpc/trigger.py 2008-11-19 01:45:11 UTC (rev 93122)
+++ ZODB/branches/patrick-pyflakes/src/ZEO/zrpc/trigger.py 2008-11-19 02:15:37 UTC (rev 93123)
@@ -152,6 +152,9 @@
# 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"
Modified: ZODB/branches/patrick-pyflakes/src/ZODB/FileStorage/fspack.py
===================================================================
--- ZODB/branches/patrick-pyflakes/src/ZODB/FileStorage/fspack.py 2008-11-19 01:45:11 UTC (rev 93122)
+++ ZODB/branches/patrick-pyflakes/src/ZODB/FileStorage/fspack.py 2008-11-19 02:15:37 UTC (rev 93123)
@@ -24,6 +24,7 @@
a backpointer after that time.
"""
+import logging
import os
from ZODB.serialize import referencesf
@@ -33,6 +34,10 @@
from ZODB.FileStorage.format import FileStorageFormatter, CorruptedDataError
from ZODB.FileStorage.format import DataHeader, TRANS_HDR_LEN
+from ZODB.POSException import UndoError
+
+logger = logging.getLogger('ZODB.FileStorage.fspack')
+
class PackCopier(FileStorageFormatter):
def __init__(self, f, index, tindex):
@@ -84,7 +89,8 @@
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:
Modified: ZODB/branches/patrick-pyflakes/src/ZODB/scripts/fsstats.py
===================================================================
--- ZODB/branches/patrick-pyflakes/src/ZODB/scripts/fsstats.py 2008-11-19 01:45:11 UTC (rev 93122)
+++ ZODB/branches/patrick-pyflakes/src/ZODB/scripts/fsstats.py 2008-11-19 02:15:37 UTC (rev 93123)
@@ -134,6 +134,7 @@
classes = {} # class -> list of oids
MAX = 0
+ objects = 0
tid = None
f = open(path, "rb")
Modified: ZODB/branches/patrick-pyflakes/src/ZODB/scripts/netspace.py
===================================================================
--- ZODB/branches/patrick-pyflakes/src/ZODB/scripts/netspace.py 2008-11-19 01:45:11 UTC (rev 93122)
+++ ZODB/branches/patrick-pyflakes/src/ZODB/scripts/netspace.py 2008-11-19 02:15:37 UTC (rev 93123)
@@ -99,6 +99,9 @@
import sys
import getopt
+ global PACK
+ global VERBOSE
+
PACK = 0
VERBOSE = 0
try:
Modified: ZODB/branches/patrick-pyflakes/src/ZODB/scripts/stats.py
===================================================================
--- ZODB/branches/patrick-pyflakes/src/ZODB/scripts/stats.py 2008-11-19 01:45:11 UTC (rev 93122)
+++ ZODB/branches/patrick-pyflakes/src/ZODB/scripts/stats.py 2008-11-19 02:15:37 UTC (rev 93123)
@@ -101,7 +101,7 @@
elif o == '-X':
heuristic = True
else:
- assert False, (o, opt)
+ assert False, (o, opts)
if len(args) != 1:
usage("exactly one file argument required")
Modified: ZODB/branches/patrick-pyflakes/src/ZODB/tests/testFileStorage.py
===================================================================
--- ZODB/branches/patrick-pyflakes/src/ZODB/tests/testFileStorage.py 2008-11-19 01:45:11 UTC (rev 93122)
+++ ZODB/branches/patrick-pyflakes/src/ZODB/tests/testFileStorage.py 2008-11-19 02:15:37 UTC (rev 93123)
@@ -356,7 +356,7 @@
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.
More information about the Zodb-checkins
mailing list