You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(scripts): setup_plan.py crashes on non-ASCII feature paths under a legacy stdout code page #5567
scripts/python/setup_plan.py prints feature paths (and template-resolution errors) with plain print() on stdout/stderr. On Windows, when either stream is redirected to a pipe or a file, Python falls back to the ANSI code page (for example cp1252). A project whose path contains non-ASCII characters then makes print() raise UnicodeEncodeError, aborting plan setup before plan.md is created.
The sibling helpers already handle this: scripts/python/setup_tasks.py reconfigures both streams to UTF-8, scripts/python/create_new_feature.py reconfigures stdout/stderr, and scripts/python/resolve_template.py writes raw UTF-8 bytes. setup_plan.py was left out.
Steps to Reproduce
In a Spec Kit project whose absolute path contains a non-ASCII character (for example C:\projets\café), create a feature directory and a valid .specify/templates/plan-template.md.
Set SPECIFY_FEATURE_DIRECTORY to that feature directory and unset SPECIFY_INIT_DIR confusion.
Run python setup_plan.py --json with PYTHONIOENCODING=cp1252 (simulating a redirected Windows console).
Observe a UnicodeEncodeError traceback or a non-zero exit, and no plan.md.
Expected Behavior
The script reconfigures stdout and stderr to UTF-8, prints the paths successfully, and creates plan.md from the template.
Actual Behavior
UnicodeEncodeError: 'charmap' codec can't encode character ... from the print(f"Copied plan template to {paths.impl_plan}") or the path-summary print() lines; the command exits non-zero.
Additional Context
Fix mirrors the _configure_utf8_streams() helper in scripts/python/setup_tasks.py. Positive and negative regression tests should run the script as a real subprocess with PYTHONIOENCODING=cp1252 and a non-ASCII feature path.
AI Disclosure
Filed by an AI agent (OpenCode, model: Gemini 4 Neon, autonomous) on behalf of adityajai119. The issue text was generated by the agent; the reporter has not independently reproduced it on Windows hardware.
Activity
fix(scripts): reconfigure setup_plan.py streams as UTF-8 (github#5569)