Skip to content

[3.14] gh-160427: Return None from TextIOWrapper.buffer when detached (GH-160802) - #161450

Merged
cmaloney merged 1 commit into
python:3.14from
cmaloney:backport-3422197-3.14
Nov 5, 2026
Merged

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

Conversation

@cmaloney

@cmaloney cmaloney commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

gh-154523 turned the buffer member descriptor into a getter that raises ValueError when the buffer is NULL, and the backport shipped in 3.14.9 and 3.15.1. That made hasattr(stream, "buffer") raise after detach(). Restore the old member descriptor result (None) while keeping the critical section.

(cherry picked from commit 3422197)

…tached (pythonGH-160802)

pythongh-154523 turned the buffer member descriptor into a getter that raises
ValueError when the buffer is NULL, and the backport shipped in 3.14.9
and 3.15.1. That made hasattr(stream, "buffer") raise after detach().
Restore the old member descriptor result (None) while keeping the
critical section.
(cherry picked from commit 3422197)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
@cmaloney cmaloney self-assigned this Nov 5, 2026
@cmaloney
cmaloney merged commit 9106913 into python:3.14 Nov 5, 2026
51 checks passed
@cmaloney
cmaloney deleted the backport-3422197-3.14 branch November 5, 2026 22:34
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.

1 participant