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
bug: UnicodeDecodeError reading .prompt.md on Windows CP950 — open() missing encoding parameter #604
acceptedLegacy acceptance marker, not approval; check the issue's human scope approval record.bugLegacy classification name; prefer type/bug. Retained while discovery consumers are migrated.
apm run start crashes with a UnicodeDecodeError when the .prompt.md file contains any character outside ASCII on a Windows system with a non-UTF-8 locale encoding (CP950, CP936, CP932).
Steps to Reproduce
Windows machine with a CJK locale (console code page CP950)
apm init my-project && cd my-project
Edit start.prompt.md to include any CJK character (e.g. # 開始)
apm run start
Actual Behaviour
[x] Script execution error: 'cp950' codec can't decode byte 0x8b in position 12: illegal multibyte sequence
Expected Behaviour
The prompt file is read as UTF-8 and the command executes successfully.
Root Cause
Three open() calls in script_runner.py do not pass an explicit encoding parameter:
PromptCompiler.compile() — reads the source .prompt.md
PromptCompiler.compile() — writes the compiled output file
ScriptRunner._execute_script() — reads the compiled file
Without encoding="utf-8", Python uses the platform default (CP950 on affected systems), which cannot decode UTF-8 multi-byte sequences.
acceptedLegacy acceptance marker, not approval; check the issue's human scope approval record.bugLegacy classification name; prefer type/bug. Retained while discovery consumers are migrated.
Activity
Standardize Unicode encodings to explicitly use UTF-8
fix: extend explicit UTF-8 encoding to 5 remaining open() call sites (#…
fix: extend explicit UTF-8 encoding to 5 remaining open() call sites (#…