Skip to content

[3.15] gh-158219: Fix bytearray constructor to not use hashed object (#158329) - #158397

Open
vstinner wants to merge 1 commit into
python:3.15from
vstinner:bytearray_hash15
Open

vstinner wants to merge 1 commit into
python:3.15from
vstinner:bytearray_hash15

Conversation

@vstinner

@vstinner vstinner commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Add _PyBytes_GET_CACHED_HASH() static inline function.

(cherry picked from commit 969af80)

…ython#158329)

Add _PyBytes_GET_CACHED_HASH() static inline function.

Co-authored-by: Cody Maloney <cmaloney@theoreticalchaos.com>
(cherry picked from commit 969af80)
@vstinner

Copy link
Copy Markdown
Member Author

@cmaloney: This bug is bad, but IMO it can wait for Python 3.15.1 bugfix. In practice, it sounds unlikely that bytearray(str, "encoding name") is used with a codec which hash its bytes object result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant