[Patches] Parsing strings with \r\n or \r

Tim Peters tim_one@email.msn.com
Sun, 28 May 2000 23:34:22 -0400


[Greg Ward, fighting with line ends while Python is parsing]

> ...
> Well, I'd like to hear if this sounds like the right solution
> before worrying about that -- let me know what you think and
> I'll refine the patch.

IMO there should be *no* #ifdefs in any of this logic:  regardless of
platform, and regardless of program source (be it file, string, file-like
object, ...), Python tokenizers should recognize all of \r\n, \n, and \r as
terminating a line (with \r\n viewed as a single line terminator when it
appears, rather than as \r first and then an empty line ending with \n).
Note that Java compilers are required to do this for Java source code, and
it's a workaround that actually works.  Somebody else will have to consider
the 3,017 other ways Unicde spells end-of-line <0.9 wink>.