Ned Deily <n...@python.org> added the comment: Thanks for the report. The behavior you see can be further isolated to socket.gethostbyname:
>>> import socket >>> h = >>> "0123456789012345678901234567890123456789012345678901234567890123.example.com" >>> socket.gethostbyname(h) Traceback (most recent call last): File "/usr/lib/python3.6/encodings/idna.py", line 165, in encode raise UnicodeError("label empty or too long") UnicodeError: label empty or too long The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<stdin>", line 1, in <module> UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long) Other socket module calls accepting host names fail similarly, such as getaddrinfo. ---------- nosy: +ned.deily stage: -> needs patch title: Urllib proxy_bypass crashes for urls containing long basic auth strings -> socket module calls with long host names can fail with idna codec error type: crash -> versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32958> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com