Repository navigation
gh-162246: Fix lost writes on BufferedRWPair dealloc - #162295
Conversation
cmaloney
left a comment
There was a problem hiding this comment.
I think this ordering works better. May be worthwhile to add a comment that the Py_CLEAR order is important in this case.
# Conflicts: # Modules/_io/bufferedio.c
|
Sorry, @maurycy and @cmaloney, I could not cleanly backport this to Please backport manually with cherry_picker, see the devguide for more information. |
|
Sorry, @maurycy and @cmaloney, I could not cleanly backport this to Please backport manually with cherry_picker, see the devguide for more information. |
|
|
GH-162344 is a backport of this pull request to the 3.15 branch. |
|
GH-162345 is a backport of this pull request to the 3.14 branch. |
) (#162345) `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>
|
GH-162351 is a backport of this pull request to the 3.15 branch. |
socket.makefile("rwb")passes the same raw stream to both sides of aBufferedRWPair. 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().