Martin v. Löwis added the comment: Serhiy: your patch still changes the type of exception, for
s.sendto(b'hello',(u'thisisaverylongstringthisisaverylongstringthisisaverylongstringthisisaverylongstring', 4242)) You get a UnicodeError now, but a socket.gaierror then. This is because the name encodes fine as ascii, but still violates the IDNA requirement on label length. My patch does the same. I don't see where your and my patch differ in behavior. But I agree that your patch is certainly much simpler, while mine might be slightly faster (for not creating copies of the host name). I'm fine with either being applied. Antoine? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22127> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com