skill-creator quick_validate.py crashes reading non-ASCII SKILL.md under non-UTF-8 locale
Description
Same root cause as the plugin-creator sample script (see #41026): codex-rs/skills/src/assets/samples/skill-creator/scripts/quick_validate.py reads SKILL.md without an explicit encoding:
content = skill_md.read_text()
Path.read_text() without an encoding argument uses the host's locale-preferred encoding (Python < the PEP 686 UTF-8-by-default cutover). On a non-UTF-8-locale Windows install (Chinese/Japanese/Korean Windows commonly default to cp936/cp932/cp949), a SKILL.md saved as UTF-8 by literally any normal editor (VS Code, the GitHub web editor, etc.) will fail to decode as soon as it contains any non-ASCII character — an accented name, an em dash, a smart quote pasted from a word processor, or non-English text in the description, all of which are completely ordinary in hand-authored documentation.
Steps to reproduce
from pathlib import Path
import tempfile
import quick_validate
skill_dir = Path(tempfile.mkdtemp())
(skill_dir / "SKILL.md").write_text(
"---\n"
"name: cafe-helper\n"
"description: Helps with caf\u00e9 orders \u2014 handles \u2019smart\u2019 quotes\n"
"---\n\nBody text.\n",
encoding="utf-8",
)
quick_validate.validate_skill(skill_dir)
On a machine whose locale encoding is cp936:
UnicodeDecodeError: 'gbk' codec can't decode byte 0x94 in position 76: illegal multibyte sequence
Expected behavior
Validating a normal, UTF-8-encoded SKILL.md with any non-ASCII punctuation or text should work regardless of the host's locale.
Actual behavior
UnicodeDecodeError on non-UTF-8-locale systems.
Environment
- Commit:
7c37479(main, 2026-08-27), Python 3.14, Windows 11, localecp936 - File:
codex-rs/skills/src/assets/samples/skill-creator/scripts/quick_validate.py:23 - Note: there is no existing test file for this script (
codex-rs/skills/tests/has notest_skill_creator.pyor equivalent).
Suggested fix
- content = skill_md.read_text()
+ content = skill_md.read_text(encoding="utf-8")
1 Comment
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action