hermes-bsd/hermes_cli
Alan Chen 2d7543c61f fix(windows): enforce UTF-8 stdout/stderr to prevent UnicodeEncodeError crash
On Windows, services and terminals default to cp1252 encoding. The CLI
uses box-drawing characters (┌│├└─) in banners, doctor output, and
status displays. When print() tries to encode these under cp1252, an
unhandled UnicodeEncodeError crashes the gateway on startup.

This fix adds early UTF-8 enforcement in hermes_cli/__init__.py:
- Sets PYTHONUTF8=1 and PYTHONIOENCODING=utf-8
- Re-opens stdout/stderr with UTF-8 encoding if not already UTF-8

Runs at import time so it protects all CLI subcommands. No effect on
Unix (gated on sys.platform == "win32"). Backwards-compatible: on
systems already using UTF-8, the function is a no-op.

Fixes #10956
2026-05-03 16:58:25 -07:00
..
__init__.py fix(windows): enforce UTF-8 stdout/stderr to prevent UnicodeEncodeError crash 2026-05-03 16:58:25 -07:00
_parser.py
auth.py fix(cli): follow 307 redirects in MiniMax OAuth httpx clients 2026-05-03 15:26:33 -07:00
auth_commands.py
azure_detect.py
backup.py
banner.py
browser_connect.py
callbacks.py
claw.py
cli_output.py
clipboard.py
codex_models.py
colors.py
commands.py fix(gateway): hide required-arg commands from Telegram menu 2026-05-03 15:29:06 -07:00
completion.py
config.py feat(openrouter): add response caching support (#19132) 2026-05-03 01:54:24 -07:00
copilot_auth.py
cron.py
curator.py fix(curator): authoritative absorbed_into on delete + restore cron skill links on rollback (#18671) (#18731) 2026-05-02 01:29:57 -07:00
curses_ui.py
debug.py fix(debug): redact log content at upload time in hermes debug share 2026-05-03 11:42:20 -07:00
default_soul.py
dingtalk_auth.py
doctor.py fix(cli): decode .env as UTF-8 to avoid GBK crash on Windows 2026-05-02 01:40:31 -07:00
dump.py
env_loader.py
fallback_cmd.py
gateway.py fix: gateway systemd unit now retries indefinitely with backoff (#18639) 2026-05-02 08:51:30 +05:30
goals.py feat: /goal — persistent cross-turn goals (Ralph loop) (#18262) 2026-04-30 23:10:20 -07:00
hooks.py
kanban.py fix(kanban): anchor board, workspaces, and worker logs at the shared Hermes root 2026-05-03 15:13:39 -07:00
kanban_db.py fix(kanban): add per-path env overrides + dispatcher env injection 2026-05-03 15:13:39 -07:00
logs.py
main.py fix(debug): redact log content at upload time in hermes debug share 2026-05-03 11:42:20 -07:00
mcp_config.py
memory_setup.py fix(cli): decode .env as UTF-8 to avoid GBK crash on Windows 2026-05-02 01:40:31 -07:00
model_catalog.py
model_normalize.py
model_switch.py fix(model): avoid bedrock credential probe in provider picker 2026-05-03 00:32:55 -07:00
models.py chore(models): move Vercel AI Gateway to bottom of provider picker (#18112) 2026-04-30 19:34:19 -07:00
nous_subscription.py
oneshot.py
pairing.py
platforms.py
plugins.py fix(plugins): bound async plugin command await with 30s timeout 2026-04-30 19:56:18 -07:00
plugins_cmd.py feat(dashboard): add Plugins page with enable/disable, auth status, install/remove 2026-04-30 20:29:37 -04:00
profiles.py Merge upstream/main and address Copilot review feedback 2026-04-30 06:43:22 -04:00
providers.py fix: prevent bare 'custom' slug in model.provider (#17478) 2026-04-30 04:32:11 -07:00
pty_bridge.py
relaunch.py
runtime_provider.py fix(fallback): let custom_providers shadow built-in aliases 2026-04-30 20:18:44 -07:00
setup.py Revert "fix(cli): CLI/TUI on local backend always uses launch directory, ignores terminal.cwd (#19242)" (#19329) 2026-05-04 00:43:58 +05:30
skills_config.py
skills_hub.py
skin_engine.py
slack_cli.py fix(paths): route achievements plugin + profile-tui through HERMES_HOME 2026-04-30 23:21:54 -07:00
status.py fix(status): add NVIDIA_API_KEY to hermes status API keys display 2026-04-30 19:46:06 -07:00
timeouts.py
tips.py
tools_config.py feat: add video_analyze tool for native video understanding (#19301) 2026-05-04 00:04:36 +05:30
uninstall.py
vercel_auth.py
voice.py
web_server.py fix: allow WebSocket connections from non-loopback IPs in --insecure mode (#18633) 2026-05-02 08:17:45 +05:30
webhook.py