[Python-Dev] urllib exception compatibility

Adam Olsen rhamph at gmail.com
Fri Sep 28 08:03:17 CEST 2007


On 9/27/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> 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.

ExternalError?  Pretty vague though.

-- 
Adam Olsen, aka Rhamphoryncus


More information about the Python-Dev mailing list