fix(windows): set UTF-8 encoding for Copilot ACP subprocess - #45144
fix(windows): set UTF-8 encoding for Copilot ACP subprocess#45144MrRealORG wants to merge 1 commit into
Conversation
…arch#45140) UnicodeDecodeError on Windows when Copilot CLI emits UTF-8 characters like emojis. Added encoding='utf-8' and errors='replace' to subprocess.Popen call. Fixes NousResearch#45140
|
This change is a subset of #45099 which adds the same If #45099 is merged first, this PR becomes redundant. Consider closing this one in favor of #45099 which has broader coverage. |
|
Closing as resolved by PR #70875 (merged, commit 0f732cb), which closed out this bug class codebase-wide: every |
Summary
Fixes #45140 - UnicodeDecodeError on Windows when Copilot CLI emits UTF-8 characters.
Problem:
On Windows, Hermes crashes when the Copilot ACP subprocess emits UTF-8 characters (e.g. emojis). The
_stdout_readerthread errors with a UnicodeDecodeError becausesubprocess.Popenis called withtext=Truebut withoutencoding, so Python uses the system codepage (cp1252) which cannot decode certain UTF-8 bytes.Fix:
Added
encoding='utf-8'anderrors='replace'to thesubprocess.Popencall in_run_promptmethod (line ~440).Testing:
How to Test:
Closes #45140