{{ message }}
gh-149816: Fix a race condition in _PyBytes_FromList with free-threading#149909
Merged
sobolevn merged 1 commit intoMay 16, 2026
Merged
gh-149816: Fix a race condition in _PyBytes_FromList with free-threading#149909sobolevn merged 1 commit into
_PyBytes_FromList with free-threading#149909sobolevn merged 1 commit into
Conversation
24 tasks
kumaraditya303
approved these changes
May 16, 2026
kumaraditya303
left a comment
Contributor
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
Hide details
View details
sobolevn
merged commit
46afba7
into
python:main
May 16, 2026
65 checks passed
|
Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
Sorry, something went wrong.
|
Sorry, @sobolevn, I could not cleanly backport this to |
Sorry, something went wrong.
Contributor
|
@sobolevn @kumaraditya303 The same issue was addressed in #132590, which takes a different approach. Using |
Sorry, something went wrong.
sobolevn
added a commit
that referenced
this pull request
May 16, 2026
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
This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.
_PyBytes_FromListis called fromPyBytes_FromObjectwhich does not own the passed object, so it is a borrowed reference.Using
_PyList_GetItemRefseems like the correct solution here.However, I was not successful in actually triggering the failure without C-API direct usage.