openai / openai/codex

skill-creator quick_validate.py crashes reading non-ASCII SKILL.md under non-UTF-8 locale

Open Beginner friendly
#41,028 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug CLI skills windows-os
Dominant language
Rust
Stars
125k
Forks
19.5k
PR merge metrics
PR metrics pending

Description

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, locale cp936
  • 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 no test_skill_creator.py or equivalent).
Suggested fix
-    content = skill_md.read_text()
+    content = skill_md.read_text(encoding="utf-8")

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at codex-rs/skills/src/assets/samples/skill-creator/scripts/quick_validate.py:23 and inspect validate_skill, then run the non-ASCII SKILL.md reproduction from the issue under a non-UTF-8 locale. Done means UTF-8-encoded SKILL.md files with non-ASCII text validate without a locale-dependent UnicodeDecodeError; no existing dedicated test file is available, so add focused coverage if appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.