Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed1.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; 'interpreter': 0.05; 'binary': 0.07; 'bug.': 0.09; 'character,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:set': 0.09; 'terminated': 0.09; 'python': 0.11; 'bug': 0.12; 'jan': 0.12; 'anyway': 0.14; '\\n,': 0.16; 'davide': 0.16; 'devs': 0.16; 'emits': 0.16; 'it;': 0.16; 'rather,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'sees': 0.16; 'subject:when': 0.16; 'using,': 0.16; 'followed': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'header:User- Agent:1': 0.23; '(or': 0.24; 'least': 0.26; 'read,': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'character': 0.29; "i'm": 0.30; 'lines': 0.31; 'assumes': 0.31; 'probably': 0.32; 'another': 0.32; 'text': 0.33; "can't": 0.35; 'knows': 0.35; 'point.': 0.35; 'but': 0.35; 'idle': 0.36; 'next': 0.36; 'subject:?': 0.36; 'should': 0.36; 'to:addr :python-list': 0.38; 'files': 0.38; 'reported': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'read': 0.60; 'blank': 0.60; 'believe': 0.68; 'line,': 0.68; 'subject:get': 0.81; 'received:fios.verizon.net': 0.84; 'imagine': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: when does newlines get set in universal newlines mode? Date: Mon, 04 May 2015 13:38:43 -0400 References: <3c45772b-77e0-4c17-8b3d-aa246c4b511c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-98-114-97-173.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1430761138 news.xs4all.nl 2965 [2001:888:2000:d::a6]:32937 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:89917 On 5/4/2015 9:35 AM, Davide Mancusi wrote: >>> I believe this is a bug. >> >> I'm not sure it is, actually; imagine the text is coming in one >> character at a time (eg from a pipe), and it's seen "alpha\r". It >> knows that this is a line, so it emits it; but until the next >> character is read, it can't know whether it's going to be \r or \r\n. >> What should it do? Read another character, which might block? Put "\r" >> into .newlines, which might be wrong? Once it sees the \n, it knows >> that it was \r\n (or rather, it assumes that files do not have lines >> of text terminated by \r followed by blank lines terminated by \n - >> because that would be stupid). > > I think this is a good point. However, I will probably submit a bug > report anyway and let the devs make their decisions. It is at least a > documentation bug. Be sure to report the exact python binary you are using, as reported when you start the interactive interpreter or Idle shell. -- Terry Jan Reedy