GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.15] gh-143008: Fix race re-initializing TextIOWrapper by cmaloney · Pull Request #151203 · python/cpython

Conversation

@cmaloney

@cmaloney cmaloney commented Jun 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

__init__ changes multiple variables and may be called more than once from multiple threads.

Backporting only a small subset of GH-145957. See #145957 (comment)

  • Issue: Null pointer dereference in TextIOWrapper.truncate via re-entrant flush #143008

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@cmaloney
pythongh-143008: Fix race re-initilaizing TextIOWrapper
ef8b7e1
__init__ changes multiple variables and may be called more than once
from multiple threads.
@cmaloney
cmaloney requested a review from vstinner June 9, 2026 18:18
@bedevere-app bedevere-app Bot added the awaiting review label Jun 9, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Jun 9, 2026
Null pointer dereference in TextIOWrapper.truncate via re-entrant flush #143008
Closed
@cmaloney cmaloney mentioned this pull request Jun 9, 2026
gh-143008: Fix Null pointer dereferences in TextIOWrapper underlying stream access #145957
Merged
@cmaloney cmaloney changed the title [3.15] gh-143008: Fix race re-initilaizing TextIOWrapper [3.15] gh-143008: Fix race re-initializing TextIOWrapper Jun 9, 2026
@vstinner vstinner added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels Jun 10, 2026
@vstinner
vstinner merged commit 0318867 into python:3.15 Jun 10, 2026
59 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Jun 10, 2026

Copy link
Copy Markdown

Thanks @cmaloney for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting review label Jun 10, 2026
@miss-islington-app

miss-islington-app Bot commented Jun 10, 2026

Copy link
Copy Markdown

Sorry, @cmaloney and @vstinner, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 0318867acf72e3acf78f480db73a69982573263a 3.13
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app miss-islington-app Bot assigned vstinner Jun 10, 2026
@bedevere-app

bedevere-app Bot commented Jun 10, 2026

Copy link
Copy Markdown

GH-151226 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jun 10, 2026
@bedevere-app

bedevere-app Bot commented Jun 10, 2026

Copy link
Copy Markdown

GH-151227 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jun 10, 2026
@vstinner

vstinner commented Jun 10, 2026

Copy link
Copy Markdown
Member

Merged, thanks for the fix. I backported it to 3.13 and 3.14 branches.

cmaloney reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner added a commit that referenced this pull request Jun 10, 2026
@vstinner @cmaloney
[3.13][3.15] gh-143008: Fix race re-initializing TextIOWrapper (#151203…
c40e6d6
…) (#151227)

[3.15] gh-143008: Fix race re-initializing TextIOWrapper (#151203)

__init__() changes multiple variables and may be called more than once
from multiple threads.

(cherry picked from commit 0318867)

Co-authored-by: Cody Maloney <[email protected]>
vstinner pushed a commit that referenced this pull request Jun 10, 2026
@miss-islington @cmaloney
[3.14] gh-143008: Fix race re-initializing TextIOWrapper (GH-151203) (#…
a4bdc21
…151226)

[3.15] gh-143008: Fix race re-initializing TextIOWrapper (GH-151203)

__init__() changes multiple variables and may be called more than once
from multiple threads.
(cherry picked from commit 0318867)

Co-authored-by: Cody Maloney <[email protected]>
@cmaloney
cmaloney deleted the backport-db4b194-3.15 branch June 10, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner Awaiting requested review from vstinner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@vstinner vstinner

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@cmaloney @vstinner
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.