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

SourceForge.net noreply at sourceforge.net
Mon Oct 6 01:10:57 EDT 2003


Patches item #816787, was opened at 2003-10-02 20:16
Message generated for change (Comment added) made by jhylton
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=816787&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
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: Jeremy Hylton (jhylton)
Date: 2003-10-06 05: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