Author cfs-pure
Recipients cfs-pure, martin.panter
Date 2016-10-27.00:35:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1477528519.44.0.744445523721.issue28539@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2016-10-27 00:35:19cfs-puresetrecipients: + cfs-pure, martin.panter
2016-10-27 00:35:19cfs-puresetmessageid: <1477528519.44.0.744445523721.issue28539@psf.upfronthosting.co.za>
2016-10-27 00:35:19cfs-purelinkissue28539 messages
2016-10-27 00:35:18cfs-purecreate