[Python-Dev] Next version of PEP278 - universal newline support - available

Just van Rossum just@letterror.com
Thu, 14 Mar 2002 12:09:05 +0100


Fredrik Lundh wrote:

> just wrote:
> 
> 
> > Am I the only one who wants universal newlines *without* a new
> > mode character?  Ideally I'd like *existing* code that works with
> > text files to accept any line ending.
> 
> on a Unix box, does the following piece of code
> open a text file or a binary data file?
> 
>     f = open(filename)

If it's not a text file, that code is broken. The question is: can we afford to
physically break that broken code? Probably not. That's why I've said earlier
that it might be an idea to turn the universal line ending hook *off* by default
on platforms where there is currently no difference between text and binary
mode.

(But I quite like your textfile() proposal, too.)

Just