Skip to content

Keep out-of-range numeric character references in the text - #605

Open
SashaMIT wants to merge 1 commit into
kurtmckee:mainfrom
SashaMIT:fix/out-of-range-charref
Open

SashaMIT wants to merge 1 commit into
kurtmckee:mainfrom
SashaMIT:fix/out-of-range-charref

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Oct 9, 2026

Copy link
Copy Markdown

Summary

�, �, and � in a title aborted parsing (OverflowError, ValueError, UnicodeEncodeError). Those references stay in the title text. A is still A.

Fixes #591

Test plan

  • Without the guard, tests/test_charref.py failed with OverflowError: Python int too large to convert to C int at mixin.py:376.
  • With the guard, python -m pytest -q tests/test_charref.py tests/test_entities.py passed (514 tests).

chr() raised on a code point past U+10FFFF, and encoding a surrogate raised too, so parsing stopped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Catch out-of-range numeric character reference exceptions

1 participant