when does newlines get set in universal newlines mode?

Chris Angelico rosuav at gmail.com
Tue May 5 04:41:12 EDT 2015


On Tue, May 5, 2015 at 6:31 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> On Monday 04 May 2015 22:13, Chris Angelico wrote:
>
>> It may be worth documenting this limitation, but it's not something
>> that can easily be fixed without removing support for \r newlines -
>> although that might be an option, given that non-OSX Macs are
>> basically history now.
>
> Non-OSX Macs are history, but the text files they created are not.

True. Like I said, "might be". I could imagine, for instance, a caveat
being put on the newlines attribute saying that "when reading a file
delimited by \r, this may erroneously imply that \r\n is being used,
until a second line has been read". But that's probably more
complexity than it's worth.

ChrisA



More information about the Python-list mailing list