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

SourceForge.net noreply at sourceforge.net
Sat Sep 30 11:04:09 CEST 2006


Bugs item #1566800, was opened at 2006-09-28 05:47
Message generated for change (Comment added) made by gbrandl
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: Closed
>Resolution: Fixed
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)

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

>Comment By: Georg Brandl (gbrandl)
Date: 2006-09-30 09:04

Message:
Logged In: YES 
user_id=849994

Thanks for the report, IOError can now again take any number
of arguments. rev.  52061, 52062 (2.5).

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

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