Bugs item #1680230, was opened at 2007-03-14 00:09 Message generated for change (Comment added) made by sonderblade 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. ---------------------------------------------------------------------- >Comment By: Bj�rn Lindqvist (sonderblade) Date: 2007-03-14 00:13 Message: Logged In: YES user_id=51702 Originator: YES File Added: test-urllib-tc-attr-err.patch ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1680230&group_id=5470
_______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com