Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: Flush stdin Date: Tue, 21 Oct 2014 01:54:47 +0300 Organization: A noiseless patient Spider Lines: 19 Message-ID: <87tx2yfj2g.fsf@elektro.pacujo.net> References: <87a94rgxi5.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="28757"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+nZUFtSCfx7QTWuivHO5dI" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:bo3gOMtBjeZJH4rVoUSVXUOXxL0= sha1:ys/gNVp6hr4neSPIpf27DhqoJwQ= Xref: csiph.com comp.lang.python:79349 Dan Stromberg : > On Sun, Oct 19, 2014 at 9:45 PM, Marko Rauhamaa 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