Charles Stephens added the comment: Our internal use case is happening through requests via urllib3 for parsing.
Essentially requests is taking the URL, passing it to urllib3 for parsing. urllib3 is returning a namedtuple of type Url which includes a host and port property which is being fed to httplib. Essentially: >>> import urllib3 >>> import httplib >>> orig_url = 'http://[2620:125:9014:3240:14:240:128:0]:8080/api/python' >>> u1 = urllib3.util.parse_url(orig_url) >>> u1 Url(scheme='http', auth=None, host='[2620:125:9014:3240:14:240:128:0]', port=8080, path='/api/python', query=None, fragment=None) >>> c1 = httplib.HTTPConnection(u1.host, port=u1.port) >>> c1.host, c1.port ('[2620:125:9014:3240:14:240:128:0]', 8080) >>> c1.request('GET', '/api/json') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/httplib.py", line 979, in request self._send_request(method, url, body, headers) File "/usr/lib/python2.7/httplib.py", line 1013, in _send_request self.endheaders(body) File "/usr/lib/python2.7/httplib.py", line 975, in endheaders self._send_output(message_body) File "/usr/lib/python2.7/httplib.py", line 835, in _send_output self.send(msg) File "/usr/lib/python2.7/httplib.py", line 797, in send self.connect() File "/usr/lib/python2.7/httplib.py", line 778, in connect self.timeout, self.source_address) File "/usr/lib/python2.7/socket.py", line 553, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno -2] Name or service not known ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28539> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com