Bundled GitHub review fetcher crashes on Unicode output under Windows CP-1252
Codex version
Codex desktop session with bundled plugin github@0.1.8-2841cf9749ae.
Environment
- Windows / PowerShell
- Python 3.12
- Active Windows locale uses CP-1252 for Python's default subprocess text decoding
- A pull request review contains Unicode punctuation and emoji generated by Copilot
Problem
The bundled GitHub plugin script:
skills/gh-address-comments/scripts/fetch_comments.py
invokes gh api graphql through subprocess in text mode without selecting UTF-8 explicitly. On Windows, the reader thread decodes gh's UTF-8 JSON using CP-1252. A Copilot review containing Unicode punctuation/emoji caused this failure:
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d ...
...
TypeError: the JSON object must be str, bytes or bytearray, not NoneType
The second exception occurs because the failed subprocess reader leaves the captured output as None, which is then passed to json.loads.
Reproduction
- On Windows with the default Python encoding resolving to CP-1252, open a repository PR whose review comments include Unicode punctuation or emoji.
- Run the bundled
fetch_comments.pyfrom the PR checkout. - Observe the subprocess reader thread fail while decoding
gh api graphqloutput, followed byjson.loads(None).
Expected behavior
The review fetcher should reliably parse GitHub's UTF-8 JSON output on Windows regardless of the active ANSI code page.
Workaround
Running the same command with:
$env:PYTHONUTF8 = '1'
succeeds and returns the complete review, thread IDs, resolution state, and Unicode content.
Suggested fix
- Decode the
ghsubprocess streams explicitly as UTF-8 (for example,encoding="utf-8"when using text mode). - Handle reader/decode failures before calling
json.loadsso the primary error is preserved. - Add a Windows/non-UTF-8-locale test fixture containing curly punctuation and emoji in a review body.
Package provenance
The installed plugin manifest points to openai/plugins, but that repository has GitHub Issues disabled, so this is filed in the Codex tracker as the public intake for a bundled Codex plugin failure.