[Python-Dev] New lines, carriage returns, and Windows
Greg Ewing
greg.ewing at canterbury.ac.nz
Sun Sep 30 02:30:45 CEST 2007
Nick Maclaren wrote:
> Grrk. That's the problem. You don't get back what you have written
You do as long as you *don't* use universal newlines mode
for reading. This is the best that can be done, because
universal newlines are inherently ambiguous.
If you want universal newlines, you just have to accept
that you can't also have \r characters meaning something
other than newlines in your files. This is true regardless
of what programming language or I/O model is being used.
--
Greg
More information about the Python-Dev
mailing list