Repository navigation
SR-5: escape unencodable characters in the stdout wrapper - #325
Draft
jothimani-rajendran wants to merge 2 commits into
Draft
jothimani-rajendran wants to merge 2 commits into
jothimani-rajendran wants to merge 2 commits into
Conversation
A cp1252 stdout raised UnicodeEncodeError on U+FFFD. Retry with backslashreplace in the stream encoding; representable text is unchanged. Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
Both writes now go through the same OSError handling, so a reader that vanishes during the backslashreplace retry no longer raises past the wrapper. Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
Collaborator
Author
|
Generated by Claude Code |
This was referenced Oct 25, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
PipeTolerantWriter.writeretries withbackslashreplacein the stream's encoding when the write raisesUnicodeEncodeError(IR-F18:chock checkon a Windows runner, stdout cp1252, crashed on U+FFFD while printing eval results). Both writes go through the same broken-pipe handling.Scope
src/chock/pipe.py,tests/test_pipe_tolerance.py, one changelog fragment..chock/untouched.Test
test_unencodable_character_is_escaped_not_raisedwrites U+FFFD through the wrapper onto a cp1252TextIOWrapper; it failed withUnicodeEncodeErrorbefore the change and passes after.test_broken_pipe_on_the_escaped_retry_is_toleratedcovers a reader that closes during the escaped retry.