Bugs item #1327971, was opened at 2005-10-16 10:41 Message generated for change (Comment added) made by kevindication You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1327971&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Kevin Dwyer (kevindication) Assigned to: Nobody/Anonymous (nobody) Summary: HTTPResponse instance has no attribute 'fileno' Initial Comment: In python2.3, the following code works. In python2.4 it fails with an AttributeError: >>> import urllib2 >>> request = urllib2.Request("http://pheared.net") >>> opener = urllib2.build_opener() >>> r = opener.open(request) >>> r.fileno() Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/socket.py", line 246, in fileno return self._sock.fileno() AttributeError: HTTPResponse instance has no attribute 'fileno' Without a fileno it's hard to do things like select. ---------------------------------------------------------------------- >Comment By: Kevin Dwyer (kevindication) Date: 2005-10-16 11:08 Message: Logged In: YES user_id=285914 I think the problem is at line 1010 in urllib2.py. --- urllib2.py-orig 2005-10-16 11:04:30.000000000 -0400 +++ urllib2.py 2005-10-16 11:05:02.000000000 -0400 @@ -1007,7 +1007,7 @@ # out of socket._fileobject() and into a base class. r.recv = r.read - fp = socket._fileobject(r) + fp = socket._fileobject(r.fp) resp = addinfourl(fp, r.msg, req.get_full_url()) resp.code = r.status ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1327971&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com