open() and EOFError

Gregory Ewing greg.ewing at canterbury.ac.nz
Mon Jul 7 01:04:12 EDT 2014


Steven D'Aprano wrote:
> Are there any circumstances where merely *opening* a file (before reading 
> it) can raise EOFError?

I don't think so. As far as I know, the only built-in
thing that raises EOFError is input() (and raw_input()
in Py2).

-- 
Greg




More information about the Python-list mailing list