-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
gh-143008: Fix Null pointer dereferences in TextIOWrapper underlying stream access #145957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
42caa08
gh-143008: Safer TextIOWrapper underlying stream access
cmaloney 551c3eb
fixup: Refer to existing helpers
cmaloney 4f455f4
fixup: More precise recursion errorcatching
cmaloney ec39a61
fixup: Formatting fixes, simplify test
cmaloney 98bc865
fixup: correct commment
cmaloney c52559b
PEP 7 fixes; simplify some comments
cmaloney 210b21b
Merge branch 'main' into textio_nullbuffer
cmaloney 150fcee
Improve PEP-7
cmaloney d7f14fc
PEP-7: Move to shorter function names, reformat arg lists
cmaloney df212a5
Improve NEWS grammer
cmaloney d1a1a98
Simplify comment
cmaloney 009cf12
Fix comment referring to function name
cmaloney afe79c7
Apply suggestions from code review
cmaloney 452168c
Assert self->buffer is locked, fix __init__ race
cmaloney d7b146e
Adjust closed_get_impl
cmaloney 593b0ea
Add back in locked assterion, match surrounding comment style
cmaloney e5c014a
Move null checks up a line
cmaloney eb23eaa
Merge remote-tracking branch 'upstream/main' into textio_nullbuffer
cmaloney 2581e6c
Fix clinic merge
cmaloney feafb90
Fix blurb
cmaloney c0bdd84
Apply suggestions from code review
cmaloney d7bf513
Remove wrapper_ref, use simpler classes, wrapper local only
cmaloney a24957d
Separate attribute and submodule imports
cmaloney c2cb455
Fix NULL with no exception after flush in detach
cmaloney cbcd21a
remove recursion. Add make_text helper and DetachOnce
cmaloney File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/Library/2025-12-21-17-56-37.gh-issue-143008.aakErJ.rst
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Fix crash in :class:`io.TextIOWrapper` when reentrant | ||
| :meth:`io.TextIOBase.detach` is called reentrantly from the underlying buffer. |
1 change: 1 addition & 0 deletions
1
Misc/NEWS.d/next/Library/2026-06-04-18-22-56.gh-issue-143008.z5tw-J.rst
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fix race conditions when re-initializing a :class:`io.TextIOWrapper` object. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
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.
Add this suggestion to a batch that can be applied as a single commit.
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.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.