Flush stdin
Marko Rauhamaa
marko at pacujo.net
Mon Oct 20 18:54:47 EDT 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.
Marko
More information about the Python-list
mailing list