[ python-Bugs-1680230 ] urllib.urlopen() raises AttributeError
SourceForge.net
noreply at sourceforge.net
Wed Mar 14 00:09:57 CET 2007
Bugs item #1680230, was opened at 2007-03-14 00:09
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1680230&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: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Björn Lindqvist (sonderblade)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib.urlopen() raises AttributeError
Initial Comment:
When you connect urlopen() to a socket that does not send any data, it produces an AttributeError.
File "/lib/python2.6/urllib.py", line 608, in http_error_default
return addinfourl(fp, headers, "http:" + url)
File "/lib/python2.6/urllib.py", line 951, in __init__
addbase.__init__(self, fp)
File "/lib/python2.6/urllib.py", line 898, in __init__
self.read = self.fp.read
AttributeError: 'NoneType' object has no attribute 'read'
Raising an exception is OK (I think?), but it should be an IOError instead of an AttributeError. See the attached patch for a test case for the bug.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1680230&group_id=5470
More information about the Python-bugs-list
mailing list