[Python-Dev] thoughts on having EOFError inherit from EnvironmentError?
Guido van Rossum
guido at python.org
Mon Apr 14 21:12:27 CEST 2008
Offhand, -0. I don't think of EOFError as an environmental error. Its
primary purpose was to have something raised by raw_input() (in 3.0,
input()) when there is no more input. This is quite a different level
of error than what EnvironmentError typically means (a problem in the
filesystem or network, or a permissions thing).
On Sat, Apr 12, 2008 at 3:01 PM, Gregory P. Smith <greg at krypto.org> wrote:
> Basically as things are now EOFError is on its own but often wants to be
> handled the same as other I/O errors that EnvironmentError currently covers.
> Many uses of EOFError in our code base do not provide it any arguments so it
> doesn't really fit the (errno, message [, filename]) tuple style that
> EnvironmentError promises. But we could fudge that with a reasonable
> default (whats reasonable?) if we rerooted this under EnvironmentError.
> Alternatively the bug suggests a new parent exception for EnvironmentError
> and EOFError both to inherit from.
> Last time changing the heirarchy around this came up there was pushback
> against adding yet another exception type so I'm thinking the simple
> re-rooting may be the best answer if anything is done at all.
> any thoughts?
> Python-Dev mailing list
> Python-Dev at python.org
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev