sha2 module still referenced even if not built (3.12.11)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python, zig
- Domain
- build-system
Research direction
Start in build.zig, where the .sha2 module is disabled by default, then inspect the Python 3.12 hashlib.py and random.py references shown in the traceback. Rebuild and use the REPL's modules check to verify that disabled sha2 support no longer causes exceptions or references to unavailable _sha2 code.
Written by the indexing model from the issue text.
Description
The module .sha2 is explicitly disabled in build.zig by default. The build completes fine, but when checking for modules in the REPL, throws exceptions:
help> modules
Please wait a moment while I gather a list of all available modules...
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
File "/mnt/mimic/pkg/python/lib/python3.12/random.py", line 68, in <module>
from _sha2 import sha512 as _sha512
ModuleNotFoundError: No module named '_sha2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/mnt/mimic/pkg/python/lib/python3.12/hashlib.py", line 245, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/mimic/pkg/python/lib/python3.12/hashlib.py", line 123, 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 "/mnt/mimic/pkg/python/lib/python3.12/random.py", line 68, in <module>
from _sha2 import sha512 as _sha512
ModuleNotFoundError: No module named '_sha2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/mnt/mimic/pkg/python/lib/python3.12/hashlib.py", line 245, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/mimic/pkg/python/lib/python3.12/hashlib.py", line 123, 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 "/mnt/mimic/pkg/python/lib/python3.12/random.py", line 68, in <module>
from _sha2 import sha512 as _sha512
ModuleNotFoundError: No module named '_sha2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/mnt/mimic/pkg/python/lib/python3.12/hashlib.py", line 245, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/mimic/pkg/python/lib/python3.12/hashlib.py", line 123, 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 "/mnt/mimic/pkg/python/lib/python3.12/random.py", line 68, in <module>
from _sha2 import sha512 as _sha512
ModuleNotFoundError: No module named '_sha2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/mnt/mimic/pkg/python/lib/python3.12/hashlib.py", line 245, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/mimic/pkg/python/lib/python3.12/hashlib.py", line 123, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
- Dominant language
- Zig
- Stars
- 19
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from allyourcodebase/cpython
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
allyourcodebase/cpython#10 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
allyourcodebase/cpython#8 · 2 comments ·
All issues in allyourcodebase/cpython
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oSoWoSo/vOid_Community_repOsitory#147 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
agentic-workflows cascade-suspected
Difficulty 1/5 Under an hour Newbie friendliness 88/100