Repository navigation
fix(tests): decode configure_seed output as UTF-8 - #13278
Conversation
configure_seed reconfigures stdout and stderr to UTF-8, but the tests decoded them with the locale encoding. Under a TEMP path with a non-ASCII character, the unreadable-cache and unwritable-seed tests read the path back in cp1252 and failed on Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Windows run of head
That matches your table. The three errors left under Logs: one run per cell; the AI-assisted: yes (Claude Code). |
malekaifa
left a comment
There was a problem hiding this comment.
Reviewed exact head 3ecb625 on Windows ACP 1252. With TEMP=TMP=C:\tmp\e_é, the two affected ConfigureSeedPathTests ( est_unreadable_cache_is_reported_without_a_traceback and est_unwritable_seed_is_reported_without_a_traceback) both pass on this head. Running the same tests from current main under the same TEMP makes both fail because the parent process decodes configure_seed's UTF-8 stderr with the locale encoding, producing a mismatched/mojibake path. Current-main and #12614 pairwise merge trees are clean, and git diff --check passes. Hosted eligibility is green; generic relinker/ASan lanes are still queued/in progress. Non-blocking integration note: #12614 adds one new subprocess call that starts configure_seed with text=True; if #12614 lands after this PR, that call should use encoding='utf-8' as well so the locale-decoding gap is not reintroduced. No blocking issue found in #13278 itself.
|
Thanks for the run. Re-ran under AI-assisted: yes (Claude Code) |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The UTF-8 decoding change matches the tool’s explicit UTF-8 output, and the focused test file passes at the reviewed head.
What I ran
Reviewed head 3ecb625ae1cf6cdb7bc4e68871e842f3ae529ca0 against base e471817c68d4e1b1e44b0ce369ed88bafe4ae8ed; the diff is limited to subprocess output decoding in tools/tests/test_configure_seed.py. Environment: Debian 12 x86-64, Python 3.11.2, Git 2.39.5. No build was needed.
git diff --check e471817c68d4e1b1e44b0ce369ed88bafe4ae8ed...3ecb625ae1cf6cdb7bc4e68871e842f3ae529ca0
python3 tools/check_conventions.py --base e471817c68d4e1b1e44b0ce369ed88bafe4ae8ed --head 3ecb625ae1cf6cdb7bc4e68871e842f3ae529ca0 --title 'fix(tests): decode configure_seed output as UTF-8' --body /tmp/anyps5-pr-13278-body.md
python3 -m unittest tools.tests.test_configure_seedResults
| Check | Result |
|---|---|
| Diff whitespace | Passed. |
| Repository conventions | Passed. |
tools.tests.test_configure_seed |
Passed: 29 tests, 1 skipped. |
| Hosted checks | Conventions, intake, labels, eligibility, Ubuntu relinker, Windows relinker, and relinker ASan passed. Two macOS relinker jobs remained queued at review time; Linux, Windows-specific, register-context, and write-watch jobs were skipped. |
Unedited local output
All conventions checks passed.
.................s...........
----------------------------------------------------------------------
Ran 29 tests in 4.428s
OK (skipped=1)
Findings
No blocking or non-blocking findings in the reviewed test-only change. The tool reconfigures its output streams to UTF-8, and the changed subprocess calls now decode those streams using UTF-8.
Sources
Not verified
I did not run the tests on Windows, Linux CI, or macOS. The hosted macOS relinker jobs were queued; they do not exercise this Python test file.
|
Checked the six |
What
tools/configure_seed.pyreconfiguresstdoutandstderrto UTF-8, buttools/tests/test_configure_seed.pyread them withtext=True, which decodes with the locale encoding (cp1252 on a Western Windows install). WhenTEMPcontains a non-ASCII character,test_unreadable_cache_is_reported_without_a_tracebackandtest_unwritable_seed_is_reported_without_a_tracebacklook for the path instderr, find it as mojibake (e_é) and fail.The six
subprocess.runcalls that startconfigure_seednow passencoding="utf-8"instead oftext=True, the same change #12993 makes fortest_unwrap_self.py. Thecmakecalls in the round-trip tests are unchanged, sincecmakedoes not write UTF-8 on its own. No tool code changes.Tested
Windows 11 Pro 10.0.22631 (code page 1252), Python 3.13.5, MSYS2 UCRT64 GCC 16.1.0 and CMake on
PATH.py -I tools/tests/test_configure_seed.py, whole file, 3 runs each:TEMPandTMPmain1edecd6...\e_é(inside code page 1252)TEMP...\zh_Ж(outside the code page)mainThe two errors under
ЖaresetUpClassofConfigureSeedTestsandConfigureSeedRoundTripTests:cmake -G Ninjawith MinGW GCC fails to configure a project under that path, the toolchain limit already noted in #13083. This PR does not change them.python tools/check_conventions.py --base origin/main: all checks passed.python tools/pr_overlap.py --branch fix/tests-configure-seed-utf8: no overlap with open pull requests. fix(tools): report configure_seed symbolic link loops as usage errors #12614 and feat(tools): preview configure seeds on stdout #12770 also edittest_configure_seed.pyand merge cleanly with this branch; fix(tools): report configure_seed symbolic link loops as usage errors #12614 adds one moretext=Truecall that startsconfigure_seed, which would want the sameencoding="utf-8".encoding="utf-8"matches what the tool writes there too; three of the six calls are in POSIX-only tests and were skipped on Windows.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code