[ python-Bugs-1566800 ] urllib doesn't raise IOError correctly with new IOError

SourceForge.net noreply at sourceforge.net
Thu Sep 28 07:47:23 CEST 2006


Bugs item #1566800, was opened at 2006-09-28 07:47
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=1566800&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: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Arthibus Gissehel (gissehel)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib doesn't raise IOError correctly with new IOError

Initial Comment:
The version I used is :

>>> sys.version
'2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 
bit (Intel)]'

On Windows XP SP2.

While I think every python 2.5 releases are concerned.

On line 357 of urllib.py from 2.5 release, there is a 
raise of an IOError with 4 arguments. It look like it 
was fine with python 2.4 but it hang up with a 
"TypeError: EnvironmentError expected at most 3 
arguments, got 4"

Concretly, when you hit a page with a "redirect" using 
error 302 for exemple, instead of raising an IOError, 
it raise a TypeError, so it break code which expect an 
IOError here (as a "normal" behavior for 302 codes)

It look like IOError is totally different between 
Python 2.4 and Python 2.5 (it was a class, it's now a 
type)

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

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


More information about the Python-bugs-list mailing list