[issue26290] fileinput and 'for line in sys.stdin' do strange mockery of input buffering

2020-11-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: For those who find this in the future, the simplest workaround for the: for line in sys.stdin: issue on Python 2 is to replace it with: for line in iter(sys.stdin.readline, ''): The problem is caused by the way file.__next__'s buffering behaves, but file.r

[issue26290] fileinput and 'for line in sys.stdin' do strange mockery of input buffering

2016-06-21 Thread Martin Panter
Martin Panter added the comment: Issue 15068 as been fixed in 3.5+ and 2.7, and it looks like it fixes the fileinput aspect of this bug. That leaves the sys.stdin aspect, which only affects Python 2, and I think is a duplicate of Issue 1633941. -- nosy: +martin.panter resolution: -> d

[issue26290] fileinput and 'for line in sys.stdin' do strange mockery of input buffering

2016-02-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For fileinput see issue15068. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-li

[issue26290] fileinput and 'for line in sys.stdin' do strange mockery of input buffering

2016-02-04 Thread Don Hatch
Don Hatch added the comment: Possibly related to http://bugs.python.org/issue1633941 . Note that the matrix of GOOD and BAD versions and input methods is exactly the same for this bug as for that one. To verify: run each of the 6 python commands I mentioned on its own, being sure to type at leas

[issue26290] fileinput and 'for line in sys.stdin' do strange mockery of input buffering

2016-02-04 Thread Don Hatch
New submission from Don Hatch: Iterating over input using either 'for line in fileinput.input():' or 'for line in sys.stdin:' has the following unexpected behavior: no matter how many lines of input the process reads, the loop body is not entered until either (1) at least 8193 chars have been rea