Serhiy Storchaka added the comment:

For now the error message virtually always contains the name (unless the length 
of its UTF-8 representation > INT_MAX). With unicode_name_maxlen.patch it 
doesn't contains the name of length few hundreds or tens characters.

Proposed patch makes the error message always contain the name, but truncated 
to NAME_MAXLEN bytes.

>>> name = ''.join(map(chr, range(0x2c80, 0x2ce4)))
>>> unicodedata.lookup(name)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: "undefined character name 
'ⲀⲁⲂⲃⲄⲅⲆⲇⲈⲉⲊⲋⲌⲍⲎⲏⲐⲑⲒⲓⲔⲕⲖⲗⲘⲙⲚⲛⲜⲝⲞⲟⲠⲡⲢⲣⲤⲥⲦⲧⲨⲩⲪⲫⲬⲭⲮⲯⲰⲱⲲⲳⲴⲵⲶⲷⲸⲹⲺⲻⲼⲽⲾⲿⳀⳁⳂⳃⳄⳅⳆⳇⳈⳉⳊⳋⳌⳍⳎⳏⳐⳑⳒⳓⳔ�...'"

----------
components: +Extension Modules
versions: +Python 3.6 -Python 3.3, Python 3.4
Added file: http://bugs.python.org/file41365/unicode_name_maxlen_trunc.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23997>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to