[issue3907] "for line in file" doesn't work for pipes

Francis Moreau report at bugs.python.org
Sun Jan 19 12:44:27 CET 2014


Francis Moreau added the comment:

Sorry for reopening this bug, but I agree with the OP, and I can still see the exact same behaviour on python 2.7.6 (archlinux).

At least, the documentation should clarify that doing "for line in file" is not strictly equivalent to the "readline" way regarding to the buffering policy used with pipes.

I'm also dubious about the buffering optimisation for the pipe case but readline() documentation should state that it will never use such buffering mechanism so we can safely use it when dealing with pipe.

Thanks

----------
nosy: +fmoreau

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3907>
_______________________________________


More information about the Python-bugs-list mailing list