Message38047
This patch enables Python to interpret all known
newline conventions,
CR, LF or CRLF, on all platforms.
This support is enabled by configuring with
--with-universal-newlines
(so by default it is off, and everything should behave
as usual).
With universal newline support enabled two things
happen:
- When importing or otherwise parsing .py files any
newline convention
is accepted.
- Python code can pass a new "t" mode parameter to
open() which
reads files with any newline convention. "t" cannot
be combined with
any other mode flags like "w" or "+", for obvious
reasons.
File objects have a new attribute "newlines" which
contains the type of
newlines encountered in the file (or None when no
newline has been seen,
or "mixed" if there were various types of newlines).
Also included is a test script which tests both file
I/O and parsing. |
|
Date |
User |
Action |
Args |
2007-08-23 15:08:46 | admin | link | issue476814 messages |
2007-08-23 15:08:46 | admin | create | |
|