[patch] verbose mode broken in fstest.py
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ZODB |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Note: I am using whatever version of ZODB that ships with Zope 2.10.7, but this bug _appears_ to still be in trunk, assuming http://
The verbose option '-v' to fstest.py no longer works (it previously did, in the version shipped with Zope 2.9). It now causes a Python error:
====
andrew@zeo:~> /opt/zope210/
Traceback (most recent call last):
File "/opt/zope210/
main()
File "/opt/zope210/
VERBOSE = VERBOSE + 1
UnboundLocalError: local variable 'VERBOSE' referenced before assignment
====
This bug was introduced by r71254, which added the def main(): wrapper. The problem is that it is attempting to use a local variable VERBOSE in the assignment statement, rather than the global variable. This is fixed by a simple patch that declares VERBOSE to be a global variable:
====
--- fstest.py.orig 2009-11-05 17:48:17.000000000 -0600
+++ fstest.py 2009-11-05 16:01:58.000000000 -0600
@@ -206,6 +206,7 @@
def main():
import getopt
+ global VERBOSE
try:
opts, args = getopt.
if len(args) != 1:
====
With the global variable declaration added, it now works correctly:
====
andrew@zeo:~> /opt/zope210/
4: transaction tid 0x0379d23cb63b7e11 #0
1111: transaction tid 0x037bd337f5194a11 #1
1960: transaction tid 0x0381a63f44093266 #2
2989: transaction tid 0x0381a63f56b5baaa #3
3428: transaction tid 0x0381a641202d0999 #4
3866: transaction tid 0x0381a642201f6e55 #5
4187: transaction tid 0x0381a6424c0e0199 #6
etc.
====
Changed in zodb: | |
status: | Fix Committed → Fix Released |
Thanks!
The fix will appear in 3.10b7.