Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[3.14] gh-141907: Better handle support for SHA3 for test_hashlib (GH-141908)#141918

Merged
picnixz merged 1 commit into
python:3.14python/cpython:3.14from
miss-islington:backport-fee7782-3.14miss-islington/cpython:backport-fee7782-3.14Copy head branch name to clipboard
Nov 25, 2025
Merged

[3.14] gh-141907: Better handle support for SHA3 for test_hashlib (GH-141908)#141918
picnixz merged 1 commit into
python:3.14python/cpython:3.14from
miss-islington:backport-fee7782-3.14miss-islington/cpython:backport-fee7782-3.14Copy head branch name to clipboard

Conversation

@miss-islington

@miss-islington miss-islington commented Nov 24, 2025

Copy link
Copy Markdown
Contributor
  • test_hashlib: better handle support for SHA3

It's possible that the SSL library supports only SHA3 algo and doesn't
have SHAKE one.

The current test wrongly detect this and set both HASH and HASHXOF to
None expecting to have the extra SHA3 attributes present but this should
only be true for SHAKE algo.

To better handle this, move the HASH condition to a dedicated try-expect
condition and check if HASHXOF is None in the relevant code effectively
checking if SHA3 is supported by the SSL library but SHAKE algo needs to
use the sha3module one.

Signed-off-by: Christian Marangi ansuelsmth@gmail.com

  • rework the conditional import for all its attrs

(cherry picked from commit fee7782)

Co-authored-by: Christian Marangi ansuelsmth@gmail.com
Signed-off-by: Christian Marangi ansuelsmth@gmail.com
Co-authored-by: Gregory P. Smith greg@krypto.org

…honGH-141908)

* test_hashlib: better handle support for SHA3

It's possible that the SSL library supports only SHA3 algo and doesn't
have SHAKE one.

The current test wrongly detect this and set both HASH and HASHXOF to
None expecting to have the extra SHA3 attributes present but this should
only be true for SHAKE algo.

To better handle this, move the HASH condition to a dedicated try-expect
condition and check if HASHXOF is None in the relevant code effectively
checking if SHA3 is supported by the SSL library but SHAKE algo needs to
use the sha3module one.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>

* rework the conditional import for all its attrs

---------
(cherry picked from commit fee7782)

Co-authored-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
@picnixz picnixz merged commit add73fd into python:3.14 Nov 25, 2025
55 checks passed
@miss-islington miss-islington deleted the backport-fee7782-3.14 branch January 2, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.