[Python-Dev] urllib exception compatibility

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Sep 28 07:50:17 CEST 2007


Gregory P. Smith wrote:
> Is IOError is the right name to use?  OSError is raised for things that 
> are not IO such as subprocess, dlopen, system.

The trouble with either of these is that the class
of errors we're talking about don't necessarily come
directly from the OS or I/O library.

Often I raise my own EnvironmentError instances for
things which don't have any associated OS error code
but are nonetheless environment-related, such as an
error in a file format.

I don't reuse IOError or OSError because I feel as
though I ought to supply an errno with these, but
there isn't any.

I suppose we could pick one of these and make it
official that it's okay to instantiate it without
an errno. But it's hard to decide which one,
because they both sound too narrow in scope.

I don't like EMError either, btw. Maybe EnvError?
Although that sounds like it has something to do
with the unix environment variables.

-- 
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