hashlib suddenly broken

Larry Martell larry.martell at gmail.com
Thu Sep 18 15:18:36 EDT 2014


On Thu, Sep 18, 2014 at 10:47 AM, John Gordon <gordon at panix.com> wrote:
> In <mailman.14109.1411057681.18130.python-list at python.org> Larry Martell <larry.martell at gmail.com> writes:
>
>> Googling this showed that it's an issue with hashlib with a common
>> cause being a file called hashlib.py that gets in the way of the
>> interpreter finding the standard hashlib module, but that doesn't seem
>> to be the case:
>
> Perhaps hashlib imports some other module which has a local module of the
> same name?

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'



>
> SHA1 has been deprecated for some time.  Maybe a recent OS update finally
> got rid of it altogether?

I did not do an OS, or any other upgrade or install.



More information about the Python-list mailing list