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 wichert
Recipients wichert
Date 2012-05-16.08:54:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
There appears to be an odd networking issue with how urllib2 sends HTTP requests. Downloading an image from gives an error:

$ python -c 'import urllib2 ; urllib2.urlopen("[2302.000.13314 a]&call=url[file:325x445]")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/", line 126, in urlopen
    return, data, timeout)
  File "/usr/lib/python2.7/", line 400, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/", line 418, in _open
    '_open', req)
  File "/usr/lib/python2.7/", line 378, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/", line 1207, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/", line 1180, in do_open
    r = h.getresponse(buffering=True)
  File "/usr/lib/python2.7/", line 1030, in getresponse
  File "/usr/lib/python2.7/", line 407, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.7/", line 365, in _read_status
    line = self.fp.readline()
  File "/usr/lib/python2.7/", line 447, in readline
    data = self._sock.recv(self._rbufsize)
socket.error: [Errno 104] Connection reset by peer

Downloading the same image using wget works fine:

$ wget '[2302.000.13314 a]&call=url[file:325x445]'             
--2012-05-16 10:53:27--[2302.000.13314%20a]&call=url[file:325x445]
Resolving (
Connecting to (||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11393 (11K) [image/jpeg]
Saving to: `maw?set=image[2302.000.13314 a]&call=url[file:325x445]'

100%[======================================>] 11,393      --.-K/s   in 0.003s  

2012-05-16 10:53:27 (3.49 MB/s) - `maw?set=image[2302.000.13314 a]&call=url[file:325x445]' saved [11393/11393]
Date User Action Args
2012-05-16 08:54:33wichertsetrecipients: + wichert
2012-05-16 08:54:33wichertsetmessageid: <>
2012-05-16 08:54:33wichertlinkissue14826 messages
2012-05-16 08:54:32wichertcreate