Skip to content

Preserve subprocess results with non-UTF-8 output - #1184

Open
jackwalkerlabs wants to merge 2 commits into
pypa:mainfrom
jackwalkerlabs:fix/non-utf8-subprocess-output
Open

Preserve subprocess results with non-UTF-8 output#1184
jackwalkerlabs wants to merge 2 commits into
pypa:mainfrom
jackwalkerlabs:fix/non-utf8-subprocess-output

Conversation

@jackwalkerlabs

@jackwalkerlabs jackwalkerlabs commented Sep 8, 2026

Copy link
Copy Markdown

A build tool emitting non-UTF-8 bytes replaces its actual exit error with UnicodeDecodeError. In verbose mode the same decoding failure can abort a successful tool invocation. Decode diagnostics with backslashreplace in both captured and streamed output so the original byte is visible and the subprocess exit status is preserved.

Three regressions run real Python subprocesses emitting byte 0xff, covering failed commands in quiet and verbose modes and successful verbose output. All fail before the change. Validation: 304 tests plus 5 subtests pass (47 platform/integration skips), Pyrefly reports zero errors and 100% public type coverage, and all changed-file pre-commit checks pass.

Implemented and locally validated with OpenAI Codex.

Issue tracking: Found during source inspection; no matching open issue was identified for this fix.

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