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.

classification
Title: hashlib module breaks with 64-bit kernel and 32-bit user space
Type: compile error Stage: resolved
Components: Build Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, christian.heimes, nascheme
Priority: normal Keywords:

Created on 2017-04-27 21:20 by nascheme, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 1332 merged nascheme, 2017-04-27 21:24
PR 2042 merged nascheme, 2017-06-09 21:50
Messages (5)
msg292485 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2017-04-27 21:20
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
msg292703 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2017-05-01 21:47
The issues seems to be resolved. In the future please add the expert for a topic or maintainer of a module to the nosy list of the ticket.
msg293048 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-05-05 06:58
Neil, can this issue be closed or do you want to backport to 3.6?
msg293118 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2017-05-05 16:13
It should be backported in my opinion.
msg295584 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2017-06-09 21:38
Create PR 2042 for backport to 3.6 branch.
History
Date User Action Args
2022-04-11 14:58:45adminsetgithub: 74378
2017-06-16 02:13:22Mariattasetstatus: open -> closed
resolution: fixed
stage: backport needed -> resolved
2017-06-09 21:50:42naschemesetpull_requests: + pull_request2105
2017-06-09 21:38:38naschemesetmessages: + msg295584
2017-05-05 16:38:14berker.peksagsetstage: patch review -> backport needed
2017-05-05 16:13:35naschemesetmessages: + msg293118
2017-05-05 06:58:19berker.peksagsetnosy: + berker.peksag
messages: + msg293048
2017-05-01 21:47:53christian.heimessetnosy: + christian.heimes
messages: + msg292703
2017-04-27 21:24:49naschemesetpull_requests: + pull_request1440
2017-04-27 21:20:03naschemecreate