report at bugs.python.org
Sun Oct 25 00:08:41 CEST 2009
New submission from Bob Cannon <bob at neqn.net>:
I used csv.writer to open a file for writing with comma as separator and
dialect='excel'. I used writerow to write each row into the file. When
I execute under linux, each line is terminated by '\r\n'. When I
execute under windows, each line is terminated by '\r\r\n'. Thus, under
MS Windows, when I read the csv file, there is a blank line between each
significant line. I have dropped cvs.writer and now build each line
manually and terminate it with '\n'. When the line is written in
windows, it is terminated by '\r\n'. That's what should happen.
As I see it, writerow with dialect='excel' should only terminate a line
with '\n'. Windows will automatically place a '\r' in front of the '\n'.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list