You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 67efbac
Browse filesBrowse the repository at this point in the historyBrowse files
fix: escape undecodable subprocess output bytes and deflake graceful shutdown test (#277)
Follow-up to #275, which decoded subprocess stdout/stderr with
errors="replace" to keep the stream-reader thread alive when a child
process emits non-UTF-8 (locale-encoded) bytes.
Switch the decode error handler from "replace" to "backslashreplace"
so undecodable bytes are escaped (e.g. b"\xc7" -> "\xc7") instead of
collapsed to U+FFFD. This keeps the reader alive exactly the same way
while preserving the original byte values in the logs, which helps
identify the codepage a DCC batch renderer is emitting. Add integration
tests covering single invalid bytes, consecutive invalid bytes, cp1252
text runs, truncated UTF-8 sequences, and that valid multi-byte UTF-8
passes through unescaped.
Also fix the flaky test_graceful_shutdown integration test that failed
on the Python 3.12 macOS CI job for #275. The test slept a fixed 0.5s
after spawning fake_client.py before sending SIGTERM; on a slow CI host
the signal could arrive before the client registered its handler,
killing the process with empty output. The client now prints a ready
line after handler registration and the test blocks on it before
signaling.
Signed-off-by: David Leong <116610336+leongdl@users.noreply.github.com>
0 commit comments