Author zach.ware
Recipients cfs-pure, martin.panter, zach.ware
Date 2016-10-27.03:13:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
That looks like a bug in urllib3 to me.  The host is *not* '[2620:125:9014:3240:14:240:128:0]', the host is '2620:125:9014:3240:14:240:128:0'; the brackets are merely for disambiguating the port.

Compare to urllib.parse.urlsplit:

>>> from urllib.parse import urlsplit
>>> s = urlsplit('http://[2620:125:9014:3240:14:240:128:0]:8080/api/python')
>>> s.hostname
>>> s.port
>>> s.netloc

I'd recommend pursuing this with urllib3, but do take a look at existing IPv6 parsing issues there as a cursory glance at their bug tracker shows several of them.

That said, I don't know of any particular reason not to strip brackets in HTTPConnection anyway.  Brackets cannot be part of a valid hostname, can they?
Date User Action Args
2016-10-27 03:13:52zach.waresetrecipients: + zach.ware, martin.panter, cfs-pure
2016-10-27 03:13:52zach.waresetmessageid: <>
2016-10-27 03:13:52zach.warelinkissue28539 messages
2016-10-27 03:13:52zach.warecreate