Bug
On Windows, running any command that outputs Unicode characters (e.g. → in trace output) without PYTHONUTF8=1 crashes with:
UnicodeEncodeError: 'charmap' codec can't encode character '→' in position 440: character maps to <undefined>
Root cause: Windows default stdout encoding is cp1252 (or similar), which cannot encode → and other Unicode symbols used in path strings like sidepanel.ts → auth/google-auth-cache.ts.
Fix
In codelens.py (or the CLI entry point), force UTF-8 stdout/stderr at startup:
import sys, io
if sys.stdout.encoding != 'utf-8':
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8', errors='replace')
This should be done unconditionally at the top of the entry point — do not rely on the user setting PYTHONUTF8=1. Users on Windows should not need an env var to get working output.
Definition of Done
- All commands produce correct output on Windows without
PYTHONUTF8=1
→ and other Unicode chars in trace paths render correctly or are replaced with ASCII fallback (->) without crashing
- No change in behavior on Linux/macOS
Labels
type: bug-fix exec: parallel
Bug
On Windows, running any command that outputs Unicode characters (e.g.
→in trace output) withoutPYTHONUTF8=1crashes with:Root cause: Windows default stdout encoding is
cp1252(or similar), which cannot encode→and other Unicode symbols used in path strings likesidepanel.ts → auth/google-auth-cache.ts.Fix
In
codelens.py(or the CLI entry point), force UTF-8 stdout/stderr at startup:This should be done unconditionally at the top of the entry point — do not rely on the user setting
PYTHONUTF8=1. Users on Windows should not need an env var to get working output.Definition of Done
PYTHONUTF8=1→and other Unicode chars in trace paths render correctly or are replaced with ASCII fallback (->) without crashingLabels
type: bug-fixexec: parallel