Repository navigation
Bugs and inconsistencies in unicodedata #80667
Description
Activity
In
unicodedata, the functionslookupandnamehave some bugs and inconsistencies.lookupmatches case-insensitively, except for the algorithmic names of Hangul syllables and CJK unified ideographs, which must be in all caps. The documentation does not explain how character names are fuzzily matched.lookupaccepts names like “CJK UNIFIED IDEOGRAPH-04E00”, where the code point has a leading zero.lookupandnamedon’t implement rule NR2, defined in chapter 4 of Unicode, for Tangut ideographs’ names.- addeddocsDocumentation in the Doc dirDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Mar 30, 2019 just hit the difference between
CJK UNIFIED IDEOGAPH-*,HANGUL SYLLABLE *and other unicode names again:>>> "\N{SNOWMAN}\N{SNOWmAn}\N{sNoWMAN}\N{snowman}" '☃☃☃☃' >>> # but: >>> "\N{CJK UNIFIED IDEOGRAPH-3400}" '㐀' >>> "\N{cjk UNIFIED IDEOGRAPH-3400}" File "<stdin>", line 1 "\N{cjk UNIFIED IDEOGRAPH-3400}" ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-29: unknown Unicode character nameReacted by Ezio Melotti- addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directoryand removeddocsDocumentation in the Doc dirDocumentation in the Doc dir3.8 (EOL)end of lifeend of life3.7 (EOL)end of lifeend of life
on Sep 26, 2025 6 remaining items
- added a commit that references this issue
on Feb 16, 2026 Thank you for your report, @dscorbett, and for your PRs, @wismill and @SnoopJ. My apologies that it took so long to review them -- we have few Unicode experts -- but finally this was resolved.
3.13 and 3.14 will only accept the Tangut ideographs' names, but not produce them. 3.15 will also produce them.
Egyptian hieroglyphs, Khitan small script characters and Nushu characters were already supported, because their names were listed explicitly in UnicodeData.txt. But this gives us opprtunity for optimization, see #144882.
Reacted by Wismill and James- added3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixes
on Feb 16, 2026 Thanks @serhiy-storchaka, glad to be of some assistance! I'm glad to see your follow-up issue as well, I was wondering about further improvements when dealing with named ranges like that as I looked over your draft PR.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs