This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients jjlee, martin.panter, orsenthil, xhchen111
Date 2019-05-05.00:51:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Today, resolves to a local (inaccessible) address for me ( After changing the proxy address to localhost, and testing with Python 2.6.8, I can’t see any evidence of a bug in Python. Winsock error 10053 is WSAECONNABORTED, which apparently can be triggered after a lower-level protocol failure or timeout. So this could be the fault of the proxy, network, or a firewall. I am closing this, assuming nobody else can to reproduce this fifteen years later.

The closest I got is the following HTTP seen at the proxy:

>>> [conn, address] = listener.accept()
>>> pprint(conn.recv(3000).splitlines(keepends=True))
[b'GET HTTP/1.1\r\n',
 b'Accept-Encoding: identity\r\n',
 b'Proxy-Authorization: Basic cGljOmlMdXNhbHQ=\r\n',
 b'Connection: close\r\n',
 b'User-Agent: Python-urllib/2.6\r\n',
>>> conn.sendall(b'HTTP/1.1 200 Okay\r\nContent-Length: 0\r\n\r\n')
>>> conn.close()
>>> [conn, address] = listener.accept()
>>> pprint(conn.recv(3000).splitlines(keepends=True))
[b'POST HTTP/1.1\r\n',
 b'Accept-Encoding: identity\r\n',
 b'Content-Length: 27\r\n',
 b'User-Agent: Python-urllib/2.6\r\n',
 b'Connection: close\r\n',
 b'Proxy-Authorization: Basic cGljOmlMdXNhbHQ=\r\n',
 b'Content-Type: application/x-www-form-urlencoded\r\n',

If I close the proxy’s listener before sending the first response, this causes ECONNREFUSED for the second request, with a similar back trace:

$ python2.6

Traceback (most recent call last):
  File "", line 13, in <module>
    response = urllib2.urlopen(request, postdata)
  File "/usr/lib/python2.6/", line 126, in urlopen
    return, data, timeout)
  File "/usr/lib/python2.6/", line 391, in open
    response = self._open(req, data)
  File "/usr/lib/python2.6/", line 409, in _open
    '_open', req)
  File "/usr/lib/python2.6/", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/", line 1181, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.6/", line 1156, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 111] Connection refused>
Date User Action Args
2019-05-05 00:51:37martin.pantersetrecipients: + martin.panter, jjlee, orsenthil, xhchen111
2019-05-05 00:51:37martin.pantersetmessageid: <>
2019-05-05 00:51:37martin.panterlinkissue1160328 messages
2019-05-05 00:51:36martin.pantercreate