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.11] gh-119506: fix _io.TextIOWrapper.write() write during flush (#119507) by methane · Pull Request #120314 · python/cpython

Conversation

@methane

@methane methane commented Jun 10, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

This PR is backport of #119507

This PR fixes TextIOWrapper's inner buffer breakage.
The bug caused assertion error when Python debug build.
I am not sure it can cause crash on release build. The bug will cause:

  • Lost buffered data, and,
  • NUL bytes can be written instead of the lost data.

Since this bug is not verified to cause crash (and DoS) in release build, I am not sure this PR is merged into security fix branches.
But this bug can cause serious bug (data lost/breakage). So I created this PR before details went away from my head.

  • Issue: _io.TextIOWrapper.write: write during flush causes pending_bytes length mismatch #119506

Sorry, something went wrong.

Uh oh!

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

All reactions
@methane
pythongh-119506: fix _io.TextIOWrapper.write() write during flush (py…
703c1e7
…thon#119507)
@methane methane added 3.11 only security fixes 3.10 (EOL) end of life 3.9 (EOL) end of life 3.8 (EOL) end of life labels Jun 10, 2024
This was referenced Jun 10, 2024
_io.TextIOWrapper.write: write during flush causes pending_bytes length mismatch #119506
Closed
gh-119506: fix _io.TextIOWrapper.write() write during flush #119507
Merged
@bedevere-app bedevere-app Bot added the awaiting core review label Jun 10, 2024
@hugovk

hugovk commented Aug 9, 2024

Copy link
Copy Markdown
Member

@pablogsal Can this be merged into 3.11 or 3.10?

All reactions

Sorry, something went wrong.

Uh oh!

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

@hugovk hugovk added the pending The issue will be closed if no feedback is provided label Aug 9, 2024
@pablogsal

pablogsal commented Aug 9, 2024

Copy link
Copy Markdown
Member

I think it makes sense to back port although doesn't seem too critical IMHO

All reactions

Sorry, something went wrong.

Uh oh!

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

pablogsal
pablogsal approved these changes Aug 9, 2024
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Aug 9, 2024
@terryjreedy

terryjreedy commented Aug 9, 2024

Copy link
Copy Markdown
Member

Only 'special' people can merge into 3.11 and before.
@pablogsal Can you still do so as release manager? @ambv I know you can. Pablo approved.
Please one of you merge or close this orphaned backport.

All reactions

Sorry, something went wrong.

Uh oh!

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

@hugovk

hugovk commented Aug 9, 2024

Copy link
Copy Markdown
Member

I can do it, let's update the PR from 3.11 first to be sure the CI still passes.

All reactions

Sorry, something went wrong.

Uh oh!

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

@hugovk
Merge branch '3.11' into 3.11-fix-textio
c497e26
@hugovk
hugovk enabled auto-merge (squash) August 9, 2024 17:03
@hugovk
hugovk merged commit 8a978a7 into python:3.11 Aug 9, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Aug 9, 2024
@AA-Turner AA-Turner removed the pending The issue will be closed if no feedback is provided label Apr 6, 2025
@methane
methane deleted the 3.11-fix-textio branch April 28, 2025 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pablogsal pablogsal pablogsal approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

3.8 (EOL) end of life 3.9 (EOL) end of life 3.10 (EOL) end of life 3.11 only security fixes

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.

5 participants

@methane @hugovk @pablogsal @terryjreedy @AA-Turner
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.