[Python-Dev] urllib exception compatibility

Guido van Rossum guido at python.org
Thu Sep 27 16:32:44 CEST 2007

How about making IOError, OSError and EnvironmentError all aliases for
the same thing? The distinction is really worthless historical

On 9/26/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Jim Jewett wrote:
> > In particular, should socket.error, ftp.Error and
> > httplib.HTTPException (used in Py3K) inherit from IOError?
> I'd say that if they incorporate a C library result code they
> should inherit from IOError, or if they incorporate a system
> call result code they should inherit from OSError. Otherwise
> they should inherit from EnvironmentError.
> I don't think there's any point in simply catching one of
> these and re-wrapping it in the library's own exeption
> class, but if such wrapping is done, it should inherit
> from EnvironmentError as well.
> It's convenient to be able to catch EnvironmentError and
> get anything that is caused by circumstances outside the
> program's control.
> --
> 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        +--------------------------------------+
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list