hashlib suddenly broken

John Gordon gordon at panix.com
Thu Sep 18 22:21:14 CEST 2014


In <mailman.14119.1411067922.18130.python-list at python.org> Larry Martell <larry.martell at gmail.com> writes:

> It's failing on the 'import _sha' in hashlib.py:

>  66   def __get_builtin_constructor(name):
>  67        try:
>  68          if name in ('SHA1', 'sha1'):
>  69   ->        import _sha
>  70              return _sha.new

> (Pdb) s
> ImportError: 'No module named _sha'

This appears to differ from the error you originally reported:

>   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py",
> line 91, in __get_builtin_constructor
>     raise ValueError('unsupported hash type %s' % name)
> ValueError: unsupported hash type sha1

Could there be two different versions of hashlib.py on your system?

-- 
John Gordon         Imagine what it must be like for a real medical doctor to
gordon at panix.com    watch 'House', or a real serial killer to watch 'Dexter'.




More information about the Python-list mailing list