[Patches] [ python-Patches-816787 ] urllib2.URLError don't calll IOError.__init__

SourceForge.net noreply at sourceforge.net
Mon Mar 12 02:35:05 CET 2007


Patches item #816787, was opened at 2003-10-02 16:16
Message generated for change (Comment added) made by collinwinter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=816787&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.3
>Status: Closed
Resolution: None
Priority: 5
Private: No
Submitted By: Miki Tebeka (tebeka)
Assigned to: Jeremy Hylton (jhylton)
Summary: urllib2.URLError don't calll IOError.__init__

Initial Comment:
The comments says it's not needed by in the case of:
---------------
from urllib2 import URLError

u = URLError(1)
u[-1]
Traceback (most recent call last):
  File "u.py", line 6, in ?
    u[-1]
AttributeError: URLError instance has no attribute 'args'
--------------
it's not what we excpect.
Attaching a patch to call IOError.__init__

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

>Comment By: Collin Winter (collinwinter)
Date: 2007-03-11 21:35

Message:
Logged In: YES 
user_id=1344176
Originator: NO

Closing, per jjlee's suggestion.

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

Comment By: John J Lee (jjlee)
Date: 2005-05-19 17:10

Message:
Logged In: YES 
user_id=261020

This should be closed:

If anybody has any further bright ideas on making urllib2's
exceptions more beautiful, they can always submit a new patch.


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

Comment By: Jeremy Hylton (jhylton)
Date: 2003-10-06 01:10

Message:
Logged In: YES 
user_id=31392

I've changed URLError to call IOError.__init__().  That's an
improvement, but it's still not great.  The typical
EnvironmentError has a two- or three-tuple where item 0 is
the errno, item 1 is a string explaining the error, and item
3 is a filenumber.  The change will creates args, but won't
set errno or strerrror.  Code expecting an errno in args[0]
will be surprised.

What do you think?


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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=816787&group_id=5470


More information about the Patches mailing list