FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.14] gh-141907: Better handle support for SHA3 for test_hashlib (GH-141908) by miss-islington · Pull Request #141918 · python/cpython · GitHub

Repository navigation

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

Merged
picnixz merged 1 commit into
python:3.14from
miss-islington:backport-fee7782-3.14
Nov 25, 2025
Merged

picnixz merged 1 commit into
python:3.14from
miss-islington:backport-fee7782-3.14

Conversation

miss-islington commented Nov 24, 2025 •
edited by bedevere-app Bot
Loading

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 merged commit add73fd into python:3.14 Nov 25, 2025
55 checks passed
miss-islington deleted the backport-fee7782-3.14 branch January 2, 2026 19:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL