Describe the bug
The documented agent setup check crashes on Windows when Python uses the default CP1252 locale encoding. The checker reads UTF-8 Markdown with Path.read_text() without an explicit encoding.
Reproduced on Windows, CPython 3.12.14, checkout 8b3c707. utils/check_ai.py is unchanged between this checkout and my existing attention-mask branch.
Reproduction
From the repository root in an installed development environment:
It exits 1 at utils/check_ai.py:50:
prose = CODE_FENCE.sub("", path.read_text())
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 7411: character maps to <undefined>
The same checkout succeeds with:
python -X utf8 utils/check_ai.py
Expected behavior and proposed scope
The check should read repository Markdown consistently as UTF-8, independent of the system locale. There are three implicit-encoding read_text() calls in this script (lines 50, 75, and 84). Proposed fix: specify encoding="utf-8" for all three and add a regression test using a non-UTF-8 default. No .ai files would change.
I can submit this focused fix if that direction is welcome. Two targeted searches for check_ai with encoding/Windows found no duplicate. Reproduction and proposed fix were investigated with AI assistance.
Describe the bug
The documented agent setup check crashes on Windows when Python uses the default CP1252 locale encoding. The checker reads UTF-8 Markdown with Path.read_text() without an explicit encoding.
Reproduced on Windows, CPython 3.12.14, checkout 8b3c707. utils/check_ai.py is unchanged between this checkout and my existing attention-mask branch.
Reproduction
From the repository root in an installed development environment:
It exits 1 at utils/check_ai.py:50:
The same checkout succeeds with:
Expected behavior and proposed scope
The check should read repository Markdown consistently as UTF-8, independent of the system locale. There are three implicit-encoding read_text() calls in this script (lines 50, 75, and 84). Proposed fix: specify encoding="utf-8" for all three and add a regression test using a non-UTF-8 default. No .ai files would change.
I can submit this focused fix if that direction is welcome. Two targeted searches for check_ai with encoding/Windows found no duplicate. Reproduction and proposed fix were investigated with AI assistance.