1 Commits
Author SHA1 Message Date
XiaoChen afd1857154 fix(cli): force utf-8 stdio so octop init does not crash on GBK consoles (#348)
Chinese Windows (GBK/cp936) encode piped/redirected CLI stdout with the
ANSI code page, so the checkmark success message in `octop init` raised
UnicodeEncodeError after the DB and admin user were already created.
Re-encode stdout/stderr to utf-8 at the CLI entry to cover the whole bug
class (init, stub, QR art, future emoji).

Add 3 unit tests (tests/unit/cli/test_main_encoding.py): two for the
guard helper and an end-to-end `octop init` run under
PYTHONIOENCODING=gbk. pytest -m "not live" passes locally; the 12
failures are pre-existing Windows/db-migration environment issues,
unchanged by this patch.
2026-08-20 16:30:54 +08:00