ERROR:root:code for hash md5 was not found

Laurent Claessens moky.math at gmail.com
Wed Jan 11 06:28:52 EST 2012


Le 11/01/2012 12:19, mike a écrit :
> Hi,
>
> We are running are running Python program on Redhat 5.5.
>
> When executing our program we get the following error ( see below).
>
> Any ideas what this is due to?

On my computer hashlib has "md5" :



Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> h=hashlib.new("md5")
>>> h.update("Hello")
>>> h.hexdigest()
'd992641f1b2b9c08b569c0a17c4e7cb8'

While if I ask for a hash method that hashlib does not know, I get the 
same error as you :

 >>> g=hashlib.new("bla")
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/lib/python2.6/hashlib.py", line 101, in __hash_new
     return __get_builtin_constructor(name)(string)
   File "/usr/lib/python2.6/hashlib.py", line 80, in 
__get_builtin_constructor
     raise ValueError, "unsupported hash type"
ValueError: unsupported hash type


You should give us a more comprehensive example of your problem.

Laurent




More information about the Python-list mailing list