GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||
GeezerVison is showing github.com — [3.14] gh-156995: Fix _PyBytes_Resize() in Free Threading (#156996) by vstinner · Pull Request #157373 · python/cpython Conversation
| ||||||||||||||||||
|
I failed to find a function in Python 3.14 stdlib which still mutates the bytes object after calling bytes = PyBytes_FromStringAndSize(NULL, size); ... write into bytes ... _PyBytes_Resize(&bytes, n); return bytes; // bytes no longer mutated from this point There is |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This change should be backported to Python 3.13, but the fix there is different because _PyBytes_Resize() doesn't test |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…on#156996) (python#157373) _PyBytes_Resize(&obj, 1) no longer returns a single byte singleton if the reference count is greater than 1. (cherry picked from commit fd569ea) Co-authored-by: Stan Ulbrych <[email protected]> Co-authored-by: Cody Maloney <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
|
GH-157436 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-157436 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…157373) (#157436) [3.14] gh-156995: Fix _PyBytes_Resize() in Free Threading (#156996) (#157373) _PyBytes_Resize(&obj, 1) no longer returns a single byte singleton if the reference count is greater than 1. (cherry picked from commit fd569ea) Co-authored-by: Stan Ulbrych <[email protected]> Co-authored-by: Cody Maloney <[email protected]>
| @@ -0,0 +1,3 @@ | |||
| On Free Threading, ``_PyBytes_Resize(&obj, 1)`` no longer returns a single byte | |||
| singleton is the current thread is different than the thread which created the | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| singleton is the current thread is different than the thread which created the | |
| singleton if the current thread is different than the thread which created the |
nit, is -> if
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Ooops, I wrote #157477 to fix the typo. Thanks for the post-merge review :-)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.