[issue25880] u'..'.encode('idna') → UnicodeError: label empty or too long

SpaceOne report at bugs.python.org
Thu Dec 17 08:42:33 EST 2015


SpaceOne added the comment:

Because i need to do everywhere where I use this:

try:
    user_input.encode(encoding)
except UnicodeDecodeError:
    raise
except (UnicodeError, UnicodeEncodeError):
    do_my_error_handling()

instead of
try:
    user_input.encode(encoding)
except UnicodeEncodeError:
    do_my_error_handling()

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25880>
_______________________________________


More information about the Python-bugs-list mailing list