Skip to content

[3.15] gh-158585: Fix _PyBytes_Resize() if hash value is already computed - #159555

Merged
vstinner merged 2 commits into
python:3.15from
vstinner:bytes_resize_15
Oct 16, 2026
Merged

vstinner merged 2 commits into
python:3.15from
vstinner:bytes_resize_15

Conversation

@vstinner

@vstinner vstinner commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

…ted (python#158589)

_PyBytes_Resize() now creates a new bytes object if the hash value
was already computed.

bytes_resize_inplace() no longer sets the hash value to -1, since
this function must not be called if the hash value was already
computed.

Add tests on PyUnicode_Resize().

(cherry picked from commit 6e7738b)
@vstinner vstinner added skip news needs backport to 3.14 bugs and security fixes labels Oct 16, 2026
@vstinner
vstinner enabled auto-merge (squash) October 16, 2026 16:22
@vstinner
vstinner merged commit 251278d into python:3.15 Oct 16, 2026
57 checks passed
@vstinner
vstinner deleted the bytes_resize_15 branch October 16, 2026 16:55
@miss-islington-app

Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @vstinner, I could not cleanly backport this to 3.14 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker 251278d5ee94bbff07a6d016aa8ff46151ef5723 3.14

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant