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 <1477538032.82.0.221575160257.issue28539@psf.upfronthosting.co.za>
In-reply-to
Content
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
'2620:125:9014:3240:14:240:128:0'
>>> s.port
8080
>>> s.netloc
'[2620:125:9014:3240:14:240:128:0]:8080'

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?
History
Date User Action Args
2016-10-27 03:13:52zach.waresetrecipients: + zach.ware, martin.panter, cfs-pure
2016-10-27 03:13:52zach.waresetmessageid: <1477538032.82.0.221575160257.issue28539@psf.upfronthosting.co.za>
2016-10-27 03:13:52zach.warelinkissue28539 messages
2016-10-27 03:13:52zach.warecreate