Commit d91336f
committed
cli: force UTF-8 stdio on startup + use platform-native fake path in run-update test
Fixes two Windows-only CLI regressions:
- UnicodeEncodeError: 'charmap' codec can't encode character
'\U0001f30d' — Windows console stdout defaults to the ANSI code
page (cp1252) which can't encode the emoji / box-drawing
characters abxpkg prints (🌍, 📦, —, …). Added _force_utf8_stdio
which reconfigure()s sys.stdout / sys.stderr to UTF-8
(with errors='replace' as belt-and-suspenders), wired into both
main() and abx_main() entrypoints. Unix stdio is already
UTF-8 so this is a no-op there. Fixes
test_abxpkg_version_runs_without_error and
test_version_report_includes_provider_local_cached_binary_list.
- test_run_update_skips_env_for_the_update_step: the hardcoded
Path("/tmp/fake-bin") literal stringifies differently on Windows
(\tmp\fake-bin) vs POSIX. Use tmp_path / 'fake-bin' on both
sides of the assertion so the comparison holds on every platform.1 parent e530aaa commit d91336f
2 files changed
+26
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
552 | 572 | | |
553 | 573 | | |
554 | 574 | | |
| |||
1849 | 1869 | | |
1850 | 1870 | | |
1851 | 1871 | | |
| 1872 | + | |
1852 | 1873 | | |
1853 | 1874 | | |
1854 | 1875 | | |
| |||
1939 | 1960 | | |
1940 | 1961 | | |
1941 | 1962 | | |
| 1963 | + | |
1942 | 1964 | | |
1943 | 1965 | | |
1944 | 1966 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
542 | 542 | | |
543 | 543 | | |
544 | 544 | | |
| 545 | + | |
| 546 | + | |
545 | 547 | | |
546 | 548 | | |
547 | | - | |
| 549 | + | |
548 | 550 | | |
549 | 551 | | |
550 | 552 | | |
| |||
585 | 587 | | |
586 | 588 | | |
587 | 589 | | |
588 | | - | |
| 590 | + | |
589 | 591 | | |
590 | 592 | | |
591 | 593 | | |
| |||
0 commit comments