Repository navigation
fix(tests): run_all.py prints a failed check's quotes into a Windows pipe instead of stopping - #2666
Merged
hckrman101 merged 2 commits intoNov 12, 2026
Conversation
…pipe instead of stopping Into a pipe, Windows' Python writes cp1252, which has no curly quotes, arrows or U+FFFD. The first failed check whose output had one (compiler errors do; the runner's own "replace" decode makes U+FFFD) ended the run with a UnicodeEncodeError, before the table, the summary line and --write-times. A pipe now gets UTF-8 and a console keeps its encoding, replacing what it cannot show, as scripts/team_chat.py does since NotRexed#2640. tests/test_run_all_output.py runs a copy of run_all.py in a scratch repository with one failing check that prints those characters, its stdout a cp1252 pipe on any OS; it fails without the change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… as on CI's Python On Windows CI's Python the stand-in check's own print() met the cp1252 pipe too and stopped with its own UnicodeEncodeError, which the runner then printed: the test caught that text, not a runner crash. The check now writes UTF-8 bytes itself, as a compiler does, and the test looks for the runner's traceback in stderr only. It still fails without the run_all.py change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nullifyshot
force-pushed
the
fix/run-all-console-encoding
branch
from
November 12, 2026 05:40
a7bc83c to
8c227d0
Compare
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.
Why: on Windows,
tests/run_all.pystops with aUnicodeEncodeErroras soon as it prints the output of a failed check that has a curly quote, an arrow or U+FFFD in it, whenever its output goes to a pipe: CI's log, an agent's tool,| more. Compiler errors have such quotes, and the runner's owndecode("utf-8", "replace")makes U+FFFD. The run then never prints its result table or its summary line, and--write-timesdoesn't write. It shows in CI too:UnicodeEncodeError: 'charmap' codec can't encode character '�'in the Windows source-check jobs. dyst found it while fixing the same crash inteam_chat.py(#2640).What changed
tests/run_all.py:unicode_output()at the start ofmain(), the same as fix(agents): team_chat.py read no longer stops at the first post on Windows #2640's forteam_chat.py. A pipe gets UTF-8 (as-X utf8would give it). A console keeps its own encoding. Either way, a character the stream can't show is replaced instead of ending the run.tests/test_run_all_output.py(new): runs a copy ofrun_all.pyin a scratch git repository with one check that fails printing‘x’ … � → …. Its stdout is a pipe withPYTHONIOENCODING=cp1252, as Windows gives one, so the test works on any OS. It checks that there's noUnicodeEncodeError, that the failed output is printed whole as UTF-8, that the summary line follows, and that the exit code is 1.Tested (Windows 11)
print(c.output.rstrip())→UnicodeEncodeError). With it, it passes.tests/run_all.py, at main 6126a2f + this change, with llvm-mingw: 415 passed, 5 failed, 71 skipped. The 5 (test_hdr_encode,test_bake_portability,test_fpx_sticky,test_input_background,test_lift_cache) fail the same way on main alone on this PC (test_hdr_encodeis also red in main's CI, fixed by fix: main's source checks pass again (15 red since #2574, #2617 and others), and the three bugs behind them #2656). This change adds no failures.Not tested: Linux, where pipes are already UTF-8 under the usual locales; the test forces cp1252 there too, but I haven't run it on Linux.
🤖 Generated with Claude Code