Skip to content

AI junk#3667

Closed
sean-kim05 wants to merge 1 commit into
pallets:mainfrom
sean-kim05:fix/fixupstream-writable-text-fallback
Closed

AI junk#3667
sean-kim05 wants to merge 1 commit into
pallets:mainfrom
sean-kim05:fix/fixupstream-writable-text-fallback

Conversation

@sean-kim05

Copy link
Copy Markdown

The 'try a binary write, then fall back to a text write' probe in _FixupStream.writable() had both branches writing b"", so the text fallback was dead: a writable text stream that lacks a native writable() method (the 'badly patched objects on sys' case the class exists for) was reported as not writable.

The primary probe was changed from write("") to write(b"") in a 2024 type-cleanup (fde47b4) without updating the fallback. Restore the fallback to a text write, matching the sibling _is_binary_writer helper which probes write(b"") then write("").

The 'try a binary write, then fall back to a text write' probe in
`_FixupStream.writable()` had both branches writing `b""`, so the text
fallback was dead: a writable text stream that lacks a native `writable()`
method (the 'badly patched objects on sys' case the class exists for) was
reported as not writable.

The primary probe was changed from `write("")` to `write(b"")` in a 2024
type-cleanup (fde47b4) without updating the fallback. Restore the fallback to
a text write, matching the sibling `_is_binary_writer` helper which probes
`write(b"")` then `write("")`.
@davidism davidism closed this Jul 7, 2026
@davidism davidism changed the title Restore text-write fallback in _FixupStream.writable() AI junk Jul 7, 2026
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