Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
This is really a corner case, but I ran across the problem today. The unicode data file foreast asian widths states:
# - All code points, assigned or unassigned, that are not listed# explicitly are given the value "N".However, that seems to not be true in theunicodedata module, eg:
$python3Python3.10.4 (main,Jun292022,12:14:53) [GCC11.2.0]onlinuxType"help","copyright","credits"or"license"formoreinformation.>>>importunicodedata>>>char=chr(0xfe75)# arbitrary unassigned code point>>>unicodedata.name(char)Traceback (mostrecentcalllast):File"<stdin>",line1,in<module>ValueError:nosuchname>>>unicodedata.east_asian_width(char)'F'
I'd be happy to fix this, if people agree that it should be fixed. FWIW, PyPy has always returned 'N' in this situation. For assigned code points everything is fine.