Skip to content

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

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

cmaloney merged 1 commit into
python:3.15from
miss-islington:backport-3422197-3.15

Conversation

@miss-islington

@miss-islington miss-islington 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)

Co-authored-by: Cody Maloney cmaloney@users.noreply.github.com

…ythonGH-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 4af98bd into python:3.15 Nov 5, 2026
56 checks passed
@miss-islington
miss-islington deleted the backport-3422197-3.15 branch November 5, 2026 22:29
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