[New-bugs-announce] [issue2760] Recent change in socket.py breaks urllib2

Thomas Herve report at bugs.python.org
Sun May 4 19:57:29 CEST 2008

New submission from Thomas Herve <therve at free.fr>:

The problematic change is here:

The following script shows the problem:

Python 2.6a2+ (trunk:62707, May  4 2008, 19:13:44) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib2
>>> r = urllib2.Request('http://pypi.python.org/simple')
>>> f = urllib2.urlopen(r)
>>> f.read()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/therve/.local/lib/python2.6/socket.py", line 326, in read
data = self._sock.recv(rbufsize)
  File "/home/therve/.local/lib/python2.6/httplib.py", line 512, in read
return self._read_chunked(amt)
  File "/home/therve/.local/lib/python2.6/httplib.py", line 548, in
line = self.fp.readline()
  File "/home/therve/.local/lib/python2.6/socket.py", line 391, in readline
assert buf.tell() == 0

components: Library (Lib)
messages: 66222
nosy: therve
severity: normal
status: open
title: Recent change in socket.py breaks urllib2
versions: Python 2.6

Tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list