[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH]merge_tests.py test 4 fails on trunk as a result of r22510

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-11-30 16:28:37 CET

Hi Lieven,

> In python when you use '\n' that's automatically converted to CR, LF or CRLF
> depending on the platform. os.linesep is '\r\n' on Windows, but because \n is
> converted actually it becomes '\r\r\n'. You probably only use os.linesep when
> writing in binary mode to files.
>
Is it so? I believe windows libc would write LF as CRLF to disk for
non-binary mode.
I believe python should treat LF as LF and CRLF as CRLF. It has no
business of converting the data.

I don't have a access to win32 now.
Can you tell me the out of the following code?
Open a notepad and write abc.txt with the following snipped content.
<snip>
line1
line2
</snip>

f = open('abc.txt')
print len(f.read())

If it prints '12' my theory would be:
'No need to bother about EOL styles, if the file is created and consumed
by the same platform'
else:
Not sure what to arrive at :)

With regards
Kamesh Jayachandran

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Nov 30 16:28:51 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.