The Python `EOFError` exception.
In Python, an EOFError
is raised in, among other situations:
- when one of the built-in functions
input()
orraw_input()
(Python 2.x only) hits an end-of-file condition (EOF) without reading any data - when the
pickle
module encounters anEOF
in its input.
A contrived example would be running the input()
function and pressing Ctrl+D (the EOF character) in IDLE, which raises an error similar to:
Traceback (most recent call last):
File "<pyshell#23>", line 1, in <module>
input()
EOFError: EOF when reading a line