Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
unicodedata.name('')
TypeError: name() argument 1 must be a unicode character, not str
'LATIN SMALL LETTER A'
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
unicodedata.name('\x00')
ValueError: no such name
Bug report
Bug description:
Consider the following:
It seems there are two issues here:
unicodedatamethods can have an undocumented TypeError exception. https://docs.python.org/3/library/unicodedata.htmlTypeErroron an empty string doesn't really seem accurate, since the function can still take other string values of the samestrtype.Either
TypeErrorshould be mentioned in documentation, or the handling of empty strings should be fixed in the library to return aValueErrorinstead.CPython versions tested on:
3.12
Operating systems tested on:
Windows, Other
Linked PRs