May be for Mac we might have to put '\r' :)
Why not use open in binary mode to ensure this integerity so that we
need not do all such juggling.
i.e
-open(imp_file_path, 'w').write("This is file test.dsp.\n")
+open(imp_file_path, 'wb').write("This is file test.dsp.\n")
I had verified the behaviour with Windows and Linux 'wb' works alike.
With regards
Kamesh Jayachandran
Malcolm Rowe wrote:
> On Wed, Jun 21, 2006 at 07:28:22PM +0530, Kamesh Jayachandran wrote:
>
>>> + # eol styl of test.dsp is CRLF, so diff will use that too. Make sure we
>>> + # define CRLF in a platform independent way.
>>> + if os.name == 'nt':
>>> + crlf = '\n'
>>> + else:
>>> + crlf = '\r\n'
>>>
>>>
>> Should it not be(Or my eyes are wrong!!), windows line endings are
>> '\r\n' and unix(posix) ones are '\n' .
>>
>>
>
> That's right, so I assume that in Python on Windows, '\n' expands to
> CR LF, while on saner platforms, it expands to LF. The code above will
> therefore assign CR LF to the crlf variable on all platforms.
>
>
>> In anycase why not use os.linesep?
>>
>>
>
> Possibly because we want CRLF in all cases?
>
> Regards,
> Malcolm
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jun 22 12:04:09 2006