3 Commits

Author SHA1 Message Date
Christopher Haugen 2961a781ab fix(scripts): treat utf_8 spelling as already-UTF-8 in the console helper
Addresses re-review: the short-circuit normalized only hyphens, so an
encoding reported as 'utf_8' (underscore) still triggered an unnecessary
reconfigure(). Normalize underscores too, and add coverage for the utf-8 /
utf_8 / UTF8 spellings vs cp1252.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-05 08:09:10 +02:00
Christopher Haugen ea40830e62 fix(scripts): address review - best-effort UTF-8 reconfigure, skip already-utf8 streams
- Never raise from stream reconfigure (wrap in try/except); a stream that
  exposes an incompatible reconfigure() no longer aborts startup.
- Skip streams already encoded as UTF-8 so redirected output is not needlessly
  re-encoded, while cp1252 consoles and cp1252 file redirects are still fixed.
- Drop the unused 'script' parametrization on the arrow-output test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-04 15:51:29 +02:00
Christopher Haugen (from Dev Box) 36d9a9885c fix(scripts): force UTF-8 on stdout/stderr so runs survive a cp1252 console
Progress output contains arrow and box-drawing characters (e.g. the
'[2/6 REFLECT] failure=0->0 groups' line and the banner rules). On a Windows
console that defaults to cp1252, writing them raises UnicodeEncodeError and
kills the process partway through a run -- after rollouts and reflect calls
have already been paid for.

Both entry points now reconfigure stdout/stderr to UTF-8 with errors='replace'
at import time, guarded by hasattr so redirected or exotic streams are left
alone.
2026-08-04 15:31:31 +02:00