This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: urllib doesn't raise IOError correctly with new IOError
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, gissehel
Priority: normal Keywords:

Created on 2006-09-28 05:47 by gissehel, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg30046 - (view) Author: Arthibus Gissehel (gissehel) Date: 2006-09-28 05:47
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)
msg30047 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-09-30 09:04
Logged In: YES 
user_id=849994

Thanks for the report, IOError can now again take any number
of arguments. rev.  52061, 52062 (2.5).
History
Date User Action Args
2022-04-11 14:56:20adminsetgithub: 44045
2006-09-28 05:47:23gissehelcreate