ERROR:root:code for hash md5 was not found

mike mikaelpetterson1 at gmail.com
Thu Jan 12 01:13:16 EST 2012


On Jan 12, 12:28 am, Steven D'Aprano <steve
+comp.lang.pyt... at pearwood.info> wrote:
> On 2012年1月11日 05:54:29 -0800, mike wrote:
> > I did some more digging and found that our class imports a "yacc.py"
> > that uses
>> > import re, types, sys, cStringIO, hashlib, os.path
>> > so it has hashlib.
>> > yacc.py seems to be an old version 1.3 ( I found 2.3 -->).
>> > Reading about hashlib it seems to be dependent on os installation of
> > OpenSSL but I cannot find out how.
>> It shouldn't be. It will use OpenSSL if available, otherwise it will fall
> back on its own code.
>> > br,
>> > //mike
>> > yacc.py
> > ===============
>> #-----------------------------------------------------------------------------> # ply: yacc.py
>> [snip over TWO THOUSAND lines of code]
>> Mike, what lead you to believe that an error in hashlib could be solved
> by posting the ENTIRE two thousand lines of yacc.py? Please do not post
> such huge chunks of code unless asked. It is unnecessary and annoying.
>> Try this. Open a terminal window and enter "python" at the prompt to
> start a clean interactive session. Then enter the following commands:
>> import sys
> print(sys.version)
> import hashlib
> print(hashlib.__file__)
> print(hashlib.md5)
> import _md5
> print(_md5.__file__)
>> and copy and paste (do not retype) the full output of these commands.
>> Thank you.
>> --
> Steven

Hi,
Sorry for posting huge file. I added your copy-paste snippet.
esekilx5030 [7:09am] [roamFroBl/pysibelius/bin] -> python
Python 2.7.2 (default, Jun 16 2011, 15:05:49)
[GCC 4.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
print(sys.version)
import hashlib
print(hashlib.__file__)
print(hashlib.md5)
import _md5
print(_md5.__file__) >>> 2.7.2 (default, Jun 16 2011, 15:05:49)
[GCC 4.5.0]
>>> ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
 File "/vobs/rnc/rrt/roam1/roamSs/roamFroBl/python/lib/python2.7/
hashlib.py", line 139, in <module>
 globals()[__func_name] = __get_hash(__func_name)
 File "/vobs/rnc/rrt/roam1/roamSs/roamFroBl/python/lib/python2.7/
hashlib.py", line 91, in __get_builtin_constructor
 raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
 File "/vobs/rnc/rrt/roam1/roamSs/roamFroBl/python/lib/python2.7/
hashlib.py", line 139, in <module>
 globals()[__func_name] = __get_hash(__func_name)
 File "/vobs/rnc/rrt/roam1/roamSs/roamFroBl/python/lib/python2.7/
hashlib.py", line 91, in __get_builtin_constructor
 raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
 File "/vobs/rnc/rrt/roam1/roamSs/roamFroBl/python/lib/python2.7/
hashlib.py", line 139, in <module>
 globals()[__func_name] = __get_hash(__func_name)
 File "/vobs/rnc/rrt/roam1/roamSs/roamFroBl/python/lib/python2.7/
hashlib.py", line 91, in __get_builtin_constructor
 raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
 File "/vobs/rnc/rrt/roam1/roamSs/roamFroBl/python/lib/python2.7/
hashlib.py", line 139, in <module>
 globals()[__func_name] = __get_hash(__func_name)
 File "/vobs/rnc/rrt/roam1/roamSs/roamFroBl/python/lib/python2.7/
hashlib.py", line 91, in __get_builtin_constructor
 raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
 File "/vobs/rnc/rrt/roam1/roamSs/roamFroBl/python/lib/python2.7/
hashlib.py", line 139, in <module>
 globals()[__func_name] = __get_hash(__func_name)
 File "/vobs/rnc/rrt/roam1/roamSs/roamFroBl/python/lib/python2.7/
hashlib.py", line 91, in __get_builtin_constructor
 raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
 File "/vobs/rnc/rrt/roam1/roamSs/roamFroBl/python/lib/python2.7/
hashlib.py", line 139, in <module>
 globals()[__func_name] = __get_hash(__func_name)
 File "/vobs/rnc/rrt/roam1/roamSs/roamFroBl/python/lib/python2.7/
hashlib.py", line 91, in __get_builtin_constructor
 raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha512
>>> /vobs/rnc/rrt/roam1/roamSs/roamFroBl/python/lib/python2.7/hashlib.pyc
>>> Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'md5'
>>> Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
ImportError: No module named _md5
Thanks for support!
//mike


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /