Make CLI UTF-8-safe so --help survives Windows cp1252 (closes #11) - #18
Merged
Conversation
A stray -> (U+2192) in the certify command's Typer help string crashed both 'volo certify --help' and (because it renders in the top-level command list) 'volo --help' with UnicodeEncodeError whenever stdout was cp1252 — i.e. any 'volo --help | cat', redirect to a file, subprocess capture, or Windows CI runner. Two fixes: (1) the help string is now ASCII; (2) _force_utf8_io() in main.py reconfigures stdout/stderr to UTF-8 (errors=replace) at import, before Click renders --help, so a future non-ASCII help string can't reintroduce the crash. No-op where the stream can't be reconfigured (e.g. pytest capture). Verified: 'volo --help' and 'volo certify --help' now exit 0 under PYTHONIOENCODING=cp1252 (were exit 1). 3 tests. Closes #11.
🛫 Volo reliability — ❌ NO-SHIPReplayed 7 adversarial scenarios against the agent (threshold ≥ 0.90).
Cost — replayed deterministically at $0 (no live API calls). baseline |
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.
Closes #11.
A stray
->(U+2192) in thecertifycommand's Typer help string crashed bothvolo certify --helpand (because it renders in the top-level command list)volo --helpwithUnicodeEncodeErrorwhenever stdout was cp1252 — anyvolo --help | cat,> file, subprocess capture, or Windows CI runner.Fix (two layers)
->instead of→)._force_utf8_io()inmain.pyreconfigures stdout/stderr to UTF-8 (errors='replace') at import — before Click renders--help— so a future non-ASCII help string can't reintroduce the crash. No-op where the stream can't be reconfigured (pytest capture), so tests are unaffected.Verification
volo --helpandvolo certify --helpnow exit 0 underPYTHONIOENCODING=cp1252(were exit 1). 3 tests including a guard that every command-group help string is cp1252-encodable. Full CLI suite 85 passed; mypy + ruff clean.