Flush stdin

Marko Rauhamaa marko at pacujo.net
Tue Oct 21 00:54:47 CEST 2014

Dan Stromberg <drsalists at gmail.com>:

> On Sun, Oct 19, 2014 at 9:45 PM, Marko Rauhamaa <marko at pacujo.net> wrote:
>> I found this comment in CPython's source code (pythonrun.c):
>>     /* stdin is always opened in buffered mode, first because it shouldn't
>>        make a difference in common use cases, second because TextIOWrapper
>>        depends on the presence of a read1() method which only exists on
>>        buffered streams.
>>     */
>> The solution is to use os.read().
> Seriously?

I wasn't joking.


More information about the Python-list mailing list