[Python-Dev] [Python-3000] Universal newlines support in Python 3.0

Adam Hupp adam at hupp.org
Tue Aug 14 18:16:21 CEST 2007


On Tue, Aug 14, 2007 at 09:58:32AM -0400, Barry Warsaw wrote:
> This was all fine except that some of the tests started  
> failing because of the EOL translation that happens unconditionally  
> now.   The file contained \r\n and the test was ensuring these EOLs  
> were preserved in the parsed text.  I switched back to opening the  
> file in binary mode, and doing a crufty conversion of bytes to  
> strings (which I suspect is error prone but gets me farther along).
> 
> It would have been perfect, I think, if I could have opened the file  
> in text mode so that read() gave me strings, with universal newlines  
> and preservation of line endings (i.e. no translation to \n).

FWIW this same issue (and solution) came up while fixing the csv
tests.

-- 
Adam Hupp | http://hupp.org/adam/



More information about the Python-Dev mailing list