Skip to content

online_checks._package_finding raises UnicodeEncodeError for a package name with a lone surrogate #862

Open

Description

@antonwolfy

dokimi/dokimi/external/online_checks.py:577 builds the registry URL with quote(name) and quote(name, safe='@'), which encode strictly. _package_finding(None, 'pypi', 'n\ud800') raises UnicodeEncodeError: 'utf-8' codec can't encode character '\ud800' in position 1: surrogates not allowed ('n\udcff' too), outside the try below it. The function-level repro is what was run; a package name takes the escape from a YAML \ud800 escape in the checked file's front matter or a script.

Fix: quote(name, errors='replace') as Context7Client.get_library_docs does now, or skip the lookup for a name that is not valid text.

Found while fixing #794. The fix's PR is #863.

Activity

  1. self-assigned this
    on Nov 17, 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