This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nascheme
Recipients nascheme
Date 2017-04-27.21:20:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1493328003.41.0.178410988374.issue30192@psf.upfronthosting.co.za>
In-reply-to
Content
The test in setup.py to check for SSE2 support is incorrect.  Checking that arch == x86_64 is not sufficient.  If the kernel is 64-bit but Python is compiled with a 32-bit compiler, the _blake2 module will fail to build.

The attached patch fixes this issue. I did a quick search of the x86_64 string, I don't see this mistake being made elsewhere but I imagine it could be done elsewhere.  Obviously a machine with a 64-bit kernel and 32-bit userspace is a rare as hen's teeth these days.  Still, I think it is worth fixing this bug.

Python 3.6.1 (default, Apr 27 2017, 20:09:03) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
  File "/home/nas/PPython-3.6.1/Lib/hashlib.py", line 243, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/home/nas/PPython-3.6.1/Lib/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/home/nas/PPython-3.6.1/Lib/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
  File "/home/nas/PPython-3.6.1/Lib/hashlib.py", line 243, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/home/nas/PPython-3.6.1/Lib/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/home/nas/PPython-3.6.1/Lib/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2s
History
Date User Action Args
2017-04-27 21:20:03naschemesetrecipients: + nascheme
2017-04-27 21:20:03naschemesetmessageid: <1493328003.41.0.178410988374.issue30192@psf.upfronthosting.co.za>
2017-04-27 21:20:03naschemelinkissue30192 messages
2017-04-27 21:20:03naschemecreate