Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.freenet.ag!ecngs!feeder2.ecngs.de!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'scripts': 0.03; 'interpreter': 0.05; 'root': 0.05; 'failing': 0.07; 'valueerror:': 0.09; 'python': 0.11; '2.7': 0.14; "%s'": 0.16; 'googling': 0.16; 'hashlib': 0.16; 'name)': 0.16; 'sha1': 0.16; 'skip:" 80': 0.16; 'subject:broken': 0.16; 'suddenly,': 0.16; '>>>': 0.22; 'import': 0.22; 'to:name:python-list@python.org': 0.22; 'module,': 0.24; "i've": 0.25; 'skip:_ 20': 0.27; 'gets': 0.27; 'raise': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'skip:/ 80': 0.31; 'file': 0.32; 'this.': 0.32; 'running': 0.33; '(most': 0.33; 'mac': 0.33; 'could': 0.34; 'common': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'found.': 0.36; 'done': 0.36; 'being': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'anything': 0.39; 'recent': 0.39; 'skip:_ 30': 0.39; 'to:addr:python.org': 0.39; 'changed': 0.39; 'called': 0.40; 'recently:': 0.84; 'wheel': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=J0Eug2VZXdSPLCGntZMLVzdUQel6ob+I2tXqw439Sdg=; b=Y/TqicumWkg92NmZpaO6S0A8Qn31LhKwkobhUO7ub4NnuxNOp2Siiu1YXXIsWY34eY SDaCSoSFYxmej8gkU4P4EaLsjBVZHjqNcSHOWwPwx/UzkXpOaQHqJoDS0e6XH87YqSQ+ garI/pRo7mFEnyJQ3skkOQOjmtFrCkj5OiIGfBWGdrHq0SqMfl9cXnaOOtj9RCe8bhNW 0zmRnyJbNV837SxdNWUyEVsUh+BWWHooOYYO0PxfXyKLXEGspsBiXG4gOiqqMC8r2/iV e/76fXsQ1cb19zKf8Uz7N1SE8Ljp+aKwBRSy5tA7w9BmyEJhF7SjiNjEqCsipFg6YlCZ S3qA== MIME-Version: 1.0 X-Received: by 10.194.119.67 with SMTP id ks3mr6217296wjb.96.1411057673519; Thu, 18 Sep 2014 09:27:53 -0700 (PDT) Date: Thu, 18 Sep 2014 10:27:53 -0600 Subject: hashlib suddenly broken From: Larry Martell To: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1411057681 news.xs4all.nl 2860 [2001:888:2000:d::a6]:52826 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:78022 I am on a mac running 10.8.5, python 2.7 Suddenly, many of my scripts started failing with: ValueError: unsupported hash type sha1 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: >>> import hashlib ERROR:root:code for hash sha1 was not found. Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 139, in globals()[__func_name] = __get_hash(__func_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 103, in __get_openssl_constructor return __get_builtin_constructor(name) 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 And that file has not changed any time recently: $ ls -l /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py -rw-r--r-- 1 root wheel 5013 Apr 12 2013 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py This just started happening yesterday, and I cannot think of anything that I've done that could cause this.