[issue32958] socket module calls with long host names can fail with idna codec error

Aaron Black report at bugs.python.org
Fri Jul 24 15:35:40 EDT 2020


Aaron Black <aaron.black at jpl.nasa.gov> added the comment:

joseph.hackman

I don't think that the 63 character limit on a label is the problem specifically, merely it's application. 

The crux of my issue was that credentials passed with the url in a basic-authy fashion (as some services require) count against the label length. For example, this would trigger the error:

h = "https://ablack:very_long_api_key_0123456789012345678901234567890123456789012345678901234567890123@www.example.com"

Since the first label would be treated as:
 "ablack:very_long_api_key_0123456789012345678901234567890123456789012345678901234567890123 at www"

My specific issue goes away if any text up to / including an "@" in the first label section is not included in the label validation. I don't know off hand if that information is supposed to be included per the label in the DNS spec though.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32958>
_______________________________________


More information about the Python-bugs-list mailing list