[ZODB-Dev] Traceback with ZODB 3.9.0

Pedro Ferreira jose.pedro.ferreira at cern.ch
Fri Sep 25 10:54:44 EDT 2009


Hello,
I was trying to migrate a machine from 3.8.1 to 3.9.0, but I'm getting 
the following error:

"""
2009-09-25T16:34:35 (2606) new connection ('137.138.4.155', 45551): 
<ManagedServerConnection ('137.138.4.155', 45551)>
2009-09-25T16:34:35 (137.138.4.155:45551) received handshake 'Z309'
2009-09-25T16:34:35 (137.138.4.155:45551) Error caught in asyncore
Traceback (most recent call last):
  File "/usr/lib64/python2.4/asyncore.py", line 77, in write
    obj.handle_write_event()
  File "/usr/lib64/python2.4/asyncore.py", line 398, in handle_write_event
    self.handle_write()
  File "/usr/lib64/python2.4/site-packages/ZEO/zrpc/smac.py", line 276, 
in handle_write
    message = message.next()
  File "/usr/lib64/python2.4/site-packages/ZEO/zrpc/smac.py", line 147, 
in hack
    self.__hmac_send = hmac.HMAC(sesskey, digestmod=ZEO.hash)
  File "/usr/lib64/python2.4/hmac.py", line 44, in __init__
    self.digest_size = digestmod.digest_size
AttributeError: 'module' object has no attribute 'digest_size'
2009-09-25T16:34:35 (2606/137.138.4.155:45551) disconnected
"""

(using Python 2.4.3 and hashlib 20060408a )

Which led me to ZEO/hash.py:

"""
try:
    import hashlib
    sha1 = hashlib.sha1
    new = sha1
except ImportError:
    import sha
    sha1 = sha.new
    new = sha1
    digest_size = sha.digest_size
"""

Adding:
  digest_size = hashlib.sha1().digest_size
inside the try block fixes it.

Is this really a bug? Or am I doing something wrong?

Regards,

Pedro




More information about the ZODB-Dev mailing list