classification
Title: Recent change in socket.py breaks urllib2
Type: Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: duplicate
Dependencies: 2632 Superseder: performance problem in socket._fileobject.read
View: 2632
Assigned To: gregory.p.smith Nosy List: draghuram, gregory.p.smith, therve
Priority: release blocker Keywords:

Created on 2008-05-04 17:57 by therve, last changed 2008-05-05 21:55 by gregory.p.smith. This issue is now closed.

Messages (4)
msg66222 - (view) Author: Thomas Herve (therve) * Date: 2008-05-04 17:57
The problematic change is here:
http://svn.python.org/view/python/trunk/Lib/socket.py?rev=62627&r1=61008&r2=62627

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
_read_chunked
line = self.fp.readline()
  File "/home/therve/.local/lib/python2.6/socket.py", line 391, in readline
assert buf.tell() == 0
AssertionError
>>>
msg66270 - (view) Author: Raghuram Devarakonda (draghuram) (Python triager) Date: 2008-05-05 14:00
Similar problem has been reported in #2632 as well.
msg66276 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2008-05-05 18:35
the change in socket was done as part of #2632.  i'm marking this a
duplicate, we'll track the issue in #2632.
msg66295 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2008-05-05 21:55
The bug introduced in r62627 has been fixed in r62744.
History
Date User Action Args
2008-05-05 21:55:54gregory.p.smithsetmessages: + msg66295
2008-05-05 18:35:43gregory.p.smithsetstatus: open -> closed
priority: release blocker
dependencies: + performance problem in socket._fileobject.read
superseder: performance problem in socket._fileobject.read
assignee: gregory.p.smith
nosy: + gregory.p.smith
messages: + msg66276
resolution: duplicate
2008-05-05 14:00:36draghuramsetnosy: + draghuram
messages: + msg66270
2008-05-04 17:57:29thervecreate