UnicodeEncodeError on Windows: report printing crashes on cp1252 in focused mode
Environment
- Windows 11, PowerShell, console codepage cp1252
- Python 3.14.3, yt-dlp 2026.08.16 nightly, ffmpeg N-124716
- Claude Code v2.1.222, skill installed manually to ~/.claude/skills/watch
What happens
Frame extraction, dedup, and transcript all complete successfully. The run then dies while printing its own report:
UnicodeEncodeError, watch.py:280Cause
watch.py:280 emits U+2192 RIGHTWARDS ARROW in the Focus range line:
f"- **Focus range:** {format_time(effective_start)} \u2192 {format_time(effective_end)} "Python's stdout defaults to cp1252 on Windows, which cannot encode it. Because that line sits inside if focused:, the crash only reproduces when --start or --end is passed; full-video runs skip it.
Note there is also an em dash at watch.py:266 on the "no audio stream found" stderr path, so escaping the arrow alone would leave a second landmine.
Repro
/watch <any URL> --detail efficient --start 0 --end 10 <question>Suggested fix
Force UTF-8 at the top of main() rather than escaping individual characters:
if hasattr(sys.stdout, "reconfigure"):
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
sys.stderr.reconfigure(encoding="utf-8", errors="replace")Workaround
PYTHONIOENCODING=utf-8, or setx PYTHONUTF8 1 for the user account.
Source: bradautomates/claude-video