Skip to content

[3.14] gh-162246: Fix lost writes on BufferedRWPair dealloc (GH-162295) - #162345

Merged
cmaloney merged 1 commit into
python:3.14from
cmaloney:backport-dc222c8-3.14
Nov 21, 2026
Merged

cmaloney merged 1 commit into
python:3.14from
cmaloney:backport-dc222c8-3.14

Conversation

@cmaloney

@cmaloney cmaloney commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

socket.makefile("rwb") passes the same raw stream to both sides of a BufferedRWPair. When the pair is deallocated, the reader closes the stream before the writer can flush its buffer.

Release the writer first, matching the order in BufferedRWPair.close().
(cherry picked from commit dc222c8)

Co-authored-by: Maurycy Pawłowski-Wieroński maurycy@maurycy.com

🤖 Generated with Claude Code

…ythonGH-162295)

`socket.makefile("rwb")` passes the same raw stream to both sides of a `BufferedRWPair`. When the pair is deallocated, the reader closes the stream before the writer can flush its buffer.

Release the writer first, matching the order in `BufferedRWPair.close()`.
(cherry picked from commit dc222c8)

Co-authored-by: Maurycy Pawłowski-Wieroński <maurycy@maurycy.com>
@cmaloney
cmaloney enabled auto-merge (squash) November 21, 2026 02:16
@cmaloney
cmaloney merged commit a8474ce into python:3.14 Nov 21, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants