]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-136929: ensure that `hashlib.<name>` does not raise `AttributeError` (#136933)
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Fri, 25 Jul 2025 14:49:09 +0000 (16:49 +0200)
committerGitHub <noreply@github.com>
Fri, 25 Jul 2025 14:49:09 +0000 (14:49 +0000)
commit7ce2f101c4b1c123860c90bf67ccc20a7805ea48
treed981e6d0bf6a2499383d181359058cdc6091640f
parentea06ae5b5e7b335efbdff03c087fad9980a53f69
gh-136929: ensure that `hashlib.<name>` does not raise `AttributeError` (#136933)

Previously, if OpenSSL was not present and built-in cryptographic extension modules
were disabled, requesting `hashlib.<name>` raised `AttributeError` and an ERROR log
message with the exception traceback is emitted when importing `hashlib`.

Now, the named constructor function will always be available but raises a `ValueError`
at runtime indicating that the algorithm is not supported. The log message has also
been reworded to be less verbose.
Doc/whatsnew/3.15.rst
Lib/hashlib.py
Misc/NEWS.d/next/Library/2025-07-21-16-13-20.gh-issue-136929.obKZ2S.rst [new file with mode: 0644]