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 Tymoteusz.Paul
Recipients Tymoteusz.Paul
Date 2014-07-01.12:18:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1404217105.77.0.742047143649.issue21896@psf.upfronthosting.co.za>
In-reply-to
Content
I've recently ran into a problem with urellib.request.urlopen that it fails against one website (that I've found so far). The website itself is working fine, I can access its content with other libraries like requests, curl and outside of python with telnet, links and so on. But with urllib it fails:

Python 3.4.1 (default, Jul  1 2014, 14:08:25)
[GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib.request
>>> urllib.request.urlopen("http://www.thomsonlocal.com/")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.4/urllib/request.py", line 153, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python3.4/urllib/request.py", line 455, in open
    response = self._open(req, data)
  File "/usr/lib64/python3.4/urllib/request.py", line 473, in _open
    '_open', req)
  File "/usr/lib64/python3.4/urllib/request.py", line 433, in _call_chain
    result = func(*args)
  File "/usr/lib64/python3.4/urllib/request.py", line 1215, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/lib64/python3.4/urllib/request.py", line 1194, in do_open
    r = h.getresponse()
  File "/usr/lib64/python3.4/http/client.py", line 1172, in getresponse
    response.begin()
  File "/usr/lib64/python3.4/http/client.py", line 351, in begin
    version, status, reason = self._read_status()
  File "/usr/lib64/python3.4/http/client.py", line 313, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib64/python3.4/socket.py", line 371, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer

I've tested it on about 6 different servers, in different parts of the world and all of them seem to be affected. I've tested with with 3.2.5, 3.3.3, 3.4.1 and they are all failed with the same trace.
History
Date User Action Args
2014-07-01 12:18:25Tymoteusz.Paulsetrecipients: + Tymoteusz.Paul
2014-07-01 12:18:25Tymoteusz.Paulsetmessageid: <1404217105.77.0.742047143649.issue21896@psf.upfronthosting.co.za>
2014-07-01 12:18:25Tymoteusz.Paullinkissue21896 messages
2014-07-01 12:18:25Tymoteusz.Paulcreate