[ZODB-Dev] ZEO tests hanging in Python2.5
Tim Peters
tim.peters at gmail.com
Sat Jun 16 15:05:41 EDT 2007
[Nikhil <nikhiln_n at rediffmail.com>]
> Testing of ZEO is hanging in Python2.5. When i traced i think it is
> failing to connect and is attempting to reconnect continously in client.py.
> Does this happen due to changes in socket module or due to in
> threading module ?
FWIW, when I looked at this about a year ago, the immediate cause was
that Python 2.5 changed exceptions from old-style classes to new-style
classes. As a result, a bit of low-level code in ZEO's lowest-level
communication layer wasn't recognizing exceptions correctly.
Don't know whether that's still the case. IIRC, it's at least part of
the problem if the find_global() function in ZEO/zrpc/marshal.py still
contains this block:
# TODO: is there a better way to do this?
if type(r) == types.ClassType and issubclass(r, Exception):
return r
types.ClassType is the type of an old-style class:
>>> class C: pass # old-style class
>>> type(C)
<type 'classobj'>
>>> class C(object): pass # new-style class
>>> type(C)
<type 'type'>
2.4:
>>> type(Exception)
<type 'classobj'>
2.5:
>>> type(Exception)
<type 'type'>
Of course it would be wise to review all uses of types.ClassType in ZODB.
More information about the ZODB-Dev
mailing list