Skip to content

fix(cli): make --help ASCII-safe for non-UTF-8 Windows consoles#112

Merged
SMI-Lab-Inha merged 1 commit into
masterfrom
fix-cli-ascii-help
May 23, 2026
Merged

fix(cli): make --help ASCII-safe for non-UTF-8 Windows consoles#112
SMI-Lab-Inha merged 1 commit into
masterfrom
fix-cli-ascii-help

Conversation

@SMI-Lab-Inha
Copy link
Copy Markdown
Owner

pybmodes --help crashed on a legacy Windows console (cp1252 / cp437) with a UnicodeEncodeError. The windio subcommand help string contained a rightwards-arrow glyph, and argparse fails to write it when the console code page has no mapping for it. Linux/macOS use UTF-8 so it passed there, which is why CI and local dev never caught it. The conda-forge Windows build did.

Fix: the printed CLI help and description strings are now plain ASCII. New tests/test_cli_help.py asserts every parser's format_help() is ASCII-encodable and also encodes on cp1252 / cp437, so this can't regress and the CLI prints on any code page.

Shipping as 1.14.1; unblocks the conda-forge submission (#33448).

The windio subcommand help carried a rightwards-arrow glyph, so
pybmodes --help raised UnicodeEncodeError when argparse wrote the help
to a legacy Windows console (cp1252 / cp437) where that character has no
mapping. The printed help and description strings are now plain ASCII,
with a test asserting every parser's formatted help is ASCII-encodable
(and encodes on cp1252 / cp437). Caught by the conda-forge Windows
build. Ship as 1.14.1.
@SMI-Lab-Inha SMI-Lab-Inha merged commit 4e3af9a into master May 23, 2026
6 checks passed
@SMI-Lab-Inha SMI-Lab-Inha deleted the fix-cli-ascii-help branch May 23, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant