[issue15068] fileinput requires two EOF when reading stdin

2012-06-15 Thread Joey Geralnik
Joey Geralnik added the comment: Forget other filelike objects. The FileInput class only works with actual files, so the readlines function should always return at least as many bytes as its first parameter. Is this assumption wrong? -- ___ Python

[issue15068] fileinput requires two EOF when reading stdin

2012-06-15 Thread Joey Geralnik
Joey Geralnik added the comment: But this is calling the readlines function, which continually reads from the file until more bytes have been read than the specified argument. >From bz2.readlines: "size can be specified to control the number of lines read: no further lines will be r

[issue15068] fileinput requires two EOF when reading stdin

2012-06-15 Thread Joey Geralnik
Joey Geralnik added the comment: First off, I'm a complete noob looking at the python source code for the first time so forgive me if I've done something wrong. What if the length of the chunk is checked as well? The following code works fine: import sys while True: