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

[3.15] gh-158585: Fix _PyBytes_Resize() if hash value is already computed by vstinner · Pull Request #159555 · python/cpython · GitHub

Repository navigation

[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 commented Oct 16, 2026 •
edited by bedevere-app Bot
Loading

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 added skip news needs backport to 3.14 bugs and security fixes labels Oct 16, 2026
vstinner enabled auto-merge (squash) October 16, 2026 16:22
vstinner merged commit 251278d into python:3.15 Oct 16, 2026
57 checks passed
vstinner deleted the bytes_resize_15 branch October 16, 2026 16:55

Copy link
Copy Markdown

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

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

vstinner removed the needs backport to 3.14 bugs and security fixes label Oct 16, 2026
vstinner added a commit that referenced this pull request Oct 16, 2026
…uted (#159585)

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

* gh-158585: Fix _PyBytes_Resize() if hash value is already computed (#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)

* gh-158585: Fix refleak in _testcapi.bytes_resize() (#158806)

(cherry picked from commit 587b7a5)
(cherry picked from commit 251278d)

* Adjust code for 3.14
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL