Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TripleSec throws errors loading sha3 in python 2.6.6 on CentOS 6.4 #8

Closed
mbainter opened this issue Feb 3, 2015 · 1 comment
Closed

Comments

@mbainter
Copy link

mbainter commented Feb 3, 2015

With the default python package on CentOS 6, and python-pip and python-devel installed, I did the pip install TripleSec, which installed: TripleSec pycrypto scrypt six pysha3 twofish salsa20

When I try to run triplesec I get this output:

$ triplesec
Traceback (most recent call last):
  File "/usr/bin/triplesec", line 9, in <module>
    load_entry_point('TripleSec==0.3', 'console_scripts', 'triplesec')()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 299, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2229, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.6/site-packages/triplesec/__init__.py", line 21, in <module>
    from .utils import (
  File "/usr/lib/python2.6/site-packages/triplesec/utils.py", line 18, in <module>
    import sha3
  File "/usr/lib64/python2.6/site-packages/sha3.py", line 11, in <module>
    _hashlib_constructor = _hashlib.__get_builtin_constructor
AttributeError: 'module' object has no attribute '__get_builtin_constructor'

Since it looks like it is actually a problem with pysha3 I tried loading it directly:

>>> import sys
>>> import hashlib
>>> sys.version_info
(2, 6, 6, 'final', 0)
>>> import sha3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/sha3.py", line 11, in <module>
    _hashlib_constructor = _hashlib.__get_builtin_constructor
AttributeError: 'module' object has no attribute '__get_builtin_constructor'

I tried searching for any indication someone else had run into this error, and poked around with the pysha3 implementation -- but they don't actually have a bug-tracker. Is there a known workaround for this issue?

@santhoshdivakar
Copy link

Hi,
I hope you have solved the problem already. I faced the same issue and I did a little hack into the system. I had python-2.7.9 with me. So in the "site-packages/sha3.py" file I replaced the line:11 with
_hashlib_constructor = _hashlib.builtins

I also noticed that when doing this, this is the only way to call the sha3 function :
s = hashlib.sha3_512()

-Hope this helps
Santhosh Divakar

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

No branches or pull requests

3 participants