stdio EOF ?

Erik Max Francis max at
Tue Aug 13 20:08:50 CEST 2002

Jacek Generowicz wrote:

> ... unfortunately empty lines are meaningful in the relevant context
> (separation of datasets); an empty line has a meaning different from
> that of EOF (no more datasets after this one).

And that code handles empty lines correctly in all cases; the .readline
method includes the trailing newline (which may only be missing on the
last line, in which case there will actually be some content and the
line preventing the truth test from failing).

I am really astonished with the amount of misinformation being put forth
in this thread.  The simple reading of text files doesn't _really_ cause
this much confusion, does it?

 Erik Max Francis / max at /
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ There is nothing so subject to the inconstancy of fortune as war.
\__/ Miguel de Cervantes
    Church /
 A lambda calculus explorer in Python.

More information about the Python-list mailing list