[Python-Dev] Universal newlines support in Python 3.0

Guido van Rossum guido at python.org
Fri Aug 10 20:23:45 CEST 2007

Python 3.0 currently has limited universal newlines support: by
default, \r\n is translated into \n for text files, but this can be
controlled by the newline= keyword parameter. For details on how, see
PEP 3116. The PEP prescribes that a lone \r must also be translated,
though this hasn't been implemented yet (any volunteers?).

However, the old universal newlines feature also set an attibute named
'newlines' on the file object to a tuple of up to three elements
giving the actual line endings that were observed on the file so far
(\r, \n, or \r\n). This feature is not in PEP 3116, and it is not
implemented. I'm tempted to kill it. Does anyone have a use case for
this? Has anyone even ever used this?

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list