[issue46947] unicodedata.name gives ValueError for control characters

2022-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a duplicate of issue18234. -- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Unicodedata module should provide access to codepoint aliases ___

[issue46947] unicodedata.name gives ValueError for control characters

2022-03-07 Thread Joe Cool
Joe Cool added the comment: My recommendation would be to add a keyword parameter, defaulting to False, to name(), something like give_full_alias, or maybe errors=“give_full_alias” like the IO functions. In the meantime, as the author of perllib, I had to make my own dict to return to the

[issue46947] unicodedata.name gives ValueError for control characters

2022-03-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: The behaviour is technically correct, but confusing and unfortunate, and I don't think we can fix it. Unicode does not define names for the ASCII control characters. But it does define aliases for them, based on the C0 control char standard.

[issue46947] unicodedata.name gives ValueError for control characters

2022-03-07 Thread Joe Cool
Joe Cool added the comment: Note: This is an issue for all chars in the ordinal range 0 thru 31. -- ___ Python tracker ___ ___

[issue46947] unicodedata.name gives ValueError for control characters

2022-03-07 Thread Joe Cool
New submission from Joe Cool : unicodedata.name gives ValueError for control characters, for example: >>> unicodedata.name('\x00') Traceback (most recent call last): File "", line 1, in ValueError: no such name >>> unicodedata.name('\t') Traceback (most recent call last): File "", line 1,