Skip to content

skill-reach build_fixture raises UnicodeEncodeError for a catalogue case name with a lone surrogate #755

Open

Description

@antonwolfy

build_fixture in dokimi/dokimi/repos/skill_reach.py writes each SKILL.md with (dest / "SKILL.md").write_bytes(text.encode()) (line 302; the symlink branch does the same at line 292), and text holds the case name (skill_text, line 262). A catalogue (skill_fixtures.v1 YAML) with name: "n\udcff" loads as a lone surrogate (load_catalogue accepts it). Repro: that catalogue with at: "project:x" and dirname: d1, then build_fixture(cases, profile, roots, outside, 's') gives UnicodeEncodeError: 'utf-8' codec can't encode character '\udcff' in position 117: surrogates not allowed at skill_reach.py:302; with the name n\ud800 it raises the same way. Fix options: refuse a name that is not UTF-8 text in _parse_case with a message (the file written is SKILL.md, which must be valid UTF-8, so surrogatepass would write invalid bytes), or encode with errors='replace' for the file only. Same class as #715, whose token already takes the case id.

Found while fixing #715. The fix's PR is #761.

Activity

  1. self-assigned this
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions