[py-dev] Problems with DOS files

holger krekel hpk at trillke.net
Fri Dec 3 03:48:21 CET 2004


[Florian Schulze Thu, Dec 02, 2004 at 09:27:21PM +0100]
> On Thu, 2 Dec 2004 11:14:45 -0800, Yaroslav Bulatov <yaroslavvb at gmail.com> 
> wrote:
> 
> >py.test runs into problems with files using DOS linebreaks (ie \r\n)
> >under Cygwin
> >
> >When I run py.test on a file with DOS linebreaks I get something like
> >
> >    def test_5():
> >                 ^
> >SyntaxError: invalid syntax
> 
> I fixed it in py/path/local/local.py by using universal newlines. Does py 
> have to run with python 2.2, if not then the attached patch should work.

right, thanks.  I did a similar fix in a slightly more general way: 
read() accepts a mode parameter itself. 

cheers, 

    holger



More information about the Pytest-dev mailing list