Skip to content

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

Closed
cmaloney wants to merge 1 commit into
python:3.15from
cmaloney:backport-dc222c8-3.15
Closed

cmaloney wants to merge 1 commit into
python:3.15from
cmaloney:backport-dc222c8-3.15

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 closed this Nov 21, 2026
auto-merge was automatically disabled November 21, 2026 02:50

Pull request was closed

@cmaloney
cmaloney deleted the backport-dc222c8-3.15 branch November 21, 2026 02:57
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