On Mon, Apr 14, 2008 at 6:59 PM, Greg Ewing <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > I don't think of EOFError as an environmental error... This is quite > > > a different level of error than what EnvironmentError typically means > > I think it depends. Any "expected" EOFErrors are going to be > caught by the surrounding code before propagating very far. > An *uncaught* EOFError probably means that a file was shorter > than you expected it to be, which counts as an environmental > error to my way of thinking.
No, that's some kind of parsing error. EnvironmentError doesn't concern itself with the contents of files. > My current coding style involves wrapping an "except EnvironmentError" > around any major operation and reporting it as a "File could not be > read/written/whatever because..." kind of message. Having > EOFError get missed by that would be a nuisance. But what operations raise EOFError? Surely you're not using raw_input()? It's really only there for teaching. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com