Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'subject:Python': 0.06; '*not*': 0.07; 'binary': 0.07; 'armin': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'jan': 0.12; 'changes': 0.15; 'posted': 0.15; 'agree.': 0.16; 'binary.': 0.16; 'ought': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'simplified': 0.16; 'stdout': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'library': 0.18; 'module': 0.19; 'seems': 0.21; 'example': 0.22; 'header :User-Agent:1': 0.23; "shouldn't": 0.24; 'header:X-Complaints- To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'unix': 0.29; 'asked': 0.31; 'code': 0.31; 'that.': 0.31; 'subject:some': 0.31; 'there.': 0.32; 'this.': 0.32; 'stuff': 0.32; 'another': 0.32; 'not.': 0.33; 'trouble': 0.34; 'problem': 0.35; 'something': 0.35; 'but': 0.35; 'really': 0.36; 'should': 0.36; 'sometimes': 0.38; 'filter': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'that,': 0.38; 'obtain': 0.39; 'received:71': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'back': 0.62; 'making': 0.63; 'show': 0.63; 'readers': 0.68; 'received:fios.verizon.net': 0.84; 'streams': 0.84; 'mistake': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Python 3.2 has some deadly infection Date: Tue, 03 Jun 2014 02:21:38 -0400 References: <538a8f48$0$29978$c3e8da3$5496439d@news.astraweb.com> <538bcfff$0$29978$c3e8da3$5496439d@news.astraweb.com> <538C5BB8.1020702@chamonix.reportlab.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-71-175-90-87.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 In-Reply-To: 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1401776514 news.xs4all.nl 2871 [2001:888:2000:d::a6]:58717 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:72478 On 6/3/2014 1:16 AM, Gregory Ewing wrote: > Terry Reedy wrote: >> The issue Armin ran into is this. He write a library module that makes >> sure the streams are binary. > > Seems to me he made a mistake right there. A library should > *not* be making global changes like that. It can obtain > binary streams from stdin and stdout for its own use, but > it shouldn't stuff them back into sys.stdin and sys.stdout. > > If he had trouble because another library did that, then > that library is broken, not Python. I agree. The example in Armin's blog rant was an application, an empty unix filter (ie, simplified cat clone). For that example the complex code he posted to show how awful Python 3 is is unneeded. When I asked what he did not directly use the fix in the doc, without the scaffolding, he switching to the 'library' module explanation. The problem is that causal readers like Robin sometimes jump from 'In Python 3, it can be hard to do something one really ought not to do' to 'Binary I/O is hard in Python 3' -- which is is not. -- Terry Jan Reedy