Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

asciidoc/python issue: "code for hash sha224 was not found" #21329

Closed
njbartlett opened this issue Jul 19, 2013 · 8 comments
Closed

asciidoc/python issue: "code for hash sha224 was not found" #21329

njbartlett opened this issue Jul 19, 2013 · 8 comments

Comments

@njbartlett
Copy link

Using asciidoc and python (both brewed) several errors are reported about unsupported hash types.

Apparently the python hashlib functionality has a dependency on openssl; this is also installed from Homebrew on my system, though I didn't understand the message about openssl not being symlinked into /usr/local.

Full error trace is as follows:

ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
@adamv
Copy link
Contributor

adamv commented Aug 5, 2013

What exactly are you doing to trigger this error? We need repro steps, and brew --config and brew doctor wouldn't hurt either.

@ghost ghost assigned adamv Aug 5, 2013
@adamv adamv closed this as completed Aug 7, 2013
@njbartlett
Copy link
Author

Apologies for slow response, I hope you can reopen given the information below.

To reproduce the issue, the following single command is sufficient: python -c "import hashlib". This will produce the error trace shown above.

Output of brew --config is as follow:

HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew
HEAD: 77277da8ffced155b7ceedd2eb5af1184b521031
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit sandybridge
OS X: 10.8.4-x86_64
Xcode: 4.6.3
CLT: 4.6.0.0.1.1365549073
LLVM-GCC: build 2336
Clang: 4.2 build 425
X11: 2.7.4 => /opt/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

Output of brew doctor:

Your system is ready to brew.

@adamv adamv reopened this Aug 11, 2013
@adamv
Copy link
Contributor

adamv commented Aug 23, 2013

Does this reproduce for anyone on 10.8?

@MikeMcQuaid
Copy link
Member

@samueljohn Brewed Python alert :D

@samueljohn
Copy link
Contributor

Oh alert? It midnight here. Can one reproduce?
Does brew reinstall python fix this for you? Perhaps you installed --with-brewed-openssl and then unlinked or removed. I can say more tomorrow.

@adamv
Copy link
Contributor

adamv commented Aug 23, 2013

Heh, not an actual alert.

@MikeMcQuaid
Copy link
Member

@samueljohn Sorry, yes,not an alert. I was more saying "you may have an idea of what is going on here and/or be able to reproduce it".

@samueljohn
Copy link
Contributor

@adamv @MikeMcQuaid it's alright - at first I thought I broke our python or something.

@njbartlett
I just tested it and - as I suspected - I can only reproduce if:

  • brew install python --with-brewed-openssl
  • brew uninstall openssl

So brew missing and brew doctor should diagnose this here. It could also be the case that there is an openssl from elsewhere that python picked up or something.

To fix this, either brew install python or if you want the brewed openssl instead of the one that comes with OS X:
brew reinstall openssl, brew reinstall python --with-brewed-openssl.

I assume this is fix and close this. If I am wrong, please provide us the brew doctor output and let us know.
Have a nice weekend all :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants