[Python-Dev] thoughts on having EOFError inherit from EnvironmentError? (original) (raw)

Gregory P. Smith greg at krypto.org
Sun Apr 13 00:01:32 CEST 2008


http://bugs.python.org/issue1481036

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?

-gps -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-dev/attachments/20080412/569d5180/attachment.htm



More information about the Python-Dev mailing list