Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!217.188.199.168.MISMATCH!takemy.news.telefonica.de!telefonica.de!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.044 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'cc:addr:python-list': 0.11; 'cc:name:python list': 0.16; 'mode,': 0.16; 'streams.': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'exists': 0.24; "shouldn't": 0.24; 'cc:2**0': 0.24; 'source': 0.25; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'comment': 0.34; 'common': 0.35; 'received:google.com': 0.35; 'method': 0.36; 'depends': 0.38; 'pm,': 0.38; 'first': 0.61; '9:45': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=dh5U4QhxdS1vMv2ZMY/whtbGtiufIMmb55hFD+XRYNE=; b=tv/BlWz+pFtc9Yi/tAc6Dp3fAqZPFPrWmQP+yOPPaccx2YX2/ssxN5UgmdnFFa7WZX tPwvk3cPr00l6xwR4ZgxkLn9IJaRZoD9edwuHSmpD001wtMI4uwar5BCdQI+ozzpX6ue YJMSzpCfK/cJbTEXE8mDBa/xlvkWdbIXAuaCxvFwZAY1/mk0l6pu6CFSKuZpHZuAuhHj vshHgRcxmQwTHp0sAw12ygptPCaLC0Nc8Zna8CeDS0xD6qKsfaXQr+toVb0TtTovDXkM 1+S0x5XqkP2XOFghKR5UvoI9zHIeJvLCMCdWsnpE78r20Ei9ikfdxNJ49tF3oWehHcp6 oyQQ== MIME-Version: 1.0 X-Received: by 10.112.56.171 with SMTP id b11mr30233095lbq.65.1413842369529; Mon, 20 Oct 2014 14:59:29 -0700 (PDT) In-Reply-To: <87a94rgxi5.fsf@elektro.pacujo.net> References: <87a94rgxi5.fsf@elektro.pacujo.net> Date: Mon, 20 Oct 2014 14:59:29 -0700 Subject: Re: Flush stdin From: Dan Stromberg To: Marko Rauhamaa Content-Type: text/plain; charset=UTF-8 Cc: Python List X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1413842371 news.xs4all.nl 2866 [2001:888:2000:d::a6]:42916 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79342 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?