[Python-Dev] urllib exception compatibility

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Sep 28 03:30:58 CEST 2007


Guido van Rossum wrote:
> How about making IOError, OSError and EnvironmentError all aliases for
> the same thing? The distinction is really worthless historical
> baggage.

To my mind, the distinction is that IOError and OSError
have an attribute for the error code, and the code found
there has a well-defined meaning (C library error code
and system call error code respectively), whereas
EnvironmentError is more general.

While it might be possible to merge them all together
on Unix-like systems, that wouldn't necessarily be
true on all platforms -- the IOError and OSError codes
might belong to different domains. Although I suppose
you could have another attribute to distinguish them
if necessary.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiem!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+


More information about the Python-Dev mailing list