Patches item #1619247, was opened at 2006-12-20 01:42
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1619247&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: Library (Lib)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Dug Song (dugsong)
Assigned to: Nobody/Anonymous (nobody)
Summary: fix urllib to raise IOError correctly

Initial Comment:
urllib.URLopener's http_error_default() is supposed to raise IOError on 
failure, but does this with an invalid number of arguments, resulting in a 
TypeError:

  File 
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib.py", 
line 357, in http_error_default
    raise IOError('http error', errcode, errmsg, headers)
TypeError: EnvironmentError expected at most 3 arguments, got 4

removing the extraneous "headers" argument, the raised exception works as 
intended:

  File 
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib.py", 
line 357, in http_error_default
    raise IOError, ('http error', errcode, errmsg)
IOError: [Errno http error] 401: 'Unauthorized'


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1619247&group_id=5470
_______________________________________________
Patches mailing list
Patches@python.org
http://mail.python.org/mailman/listinfo/patches

Reply via email to