This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skip.montanaro
Recipients baloan, eric.araujo, skip.montanaro, zacktu
Date 2010-07-28.17:19:35
SpamBayes Score 0.00012997308
Marked as misclassified No
Message-id <1280337578.31.0.063561994913.issue7198@psf.upfronthosting.co.za>
In-reply-to
Content
I got access to Python 2.6.5 on Windows and ran this simple
example:

Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.

    ****************************************************************
    Personal firewall software may warn about the connection IDLE
    makes to its subprocess using this computer's internal loopback
    interface.  This connection is not visible on any external
    interface and no data is sent to or received from the Internet.
    ****************************************************************
    
IDLE 2.6.5      
>>> f = open("H:sample.csv", "wb")
>>> import csv
>>> writer = csv.writer(f)
>>> writer.writerow([1,2,3])
>>> writer.writerow(['a', 'b', 'c'])
>>> del writer
>>> f.close()
>>> 

I then looked at the CSV file which it generated.
Looked find to me.  Each of the two rows was terminated
by a single CRLF pair.

Then I repeated the "test", opening the file in text
mode:

>>> f = open("H:sample2.csv", "w")

>>> writer = csv.writer(f)

>>> writer.writerow([1,2,3])

>>> writer.writerow(['a', 'b', 'c'])

>>> del writer

>>> f.close()

>>> 

That output does indeed terminate each line with
CRCRLF and when viewed in a spreadsheet program
such as OpenOffice Calc (probably Excel as well),
displays a blank line between the 123 row and the
abc row.

I've removed the "unit test needed" attribute from the
ticket as there is a test_writerows test case in the
Python test suite.  Also closing again and marking
invalid.  If you still believe there is actually a
problem, feel free to reopen this issue, but also
please send me (skip@pobox.com) a short example and
the erroneous output it produces for you (attach your
two files - don't just embed them in your mail msg).
History
Date User Action Args
2010-07-28 17:19:38skip.montanarosetrecipients: + skip.montanaro, baloan, eric.araujo, zacktu
2010-07-28 17:19:38skip.montanarosetmessageid: <1280337578.31.0.063561994913.issue7198@psf.upfronthosting.co.za>
2010-07-28 17:19:36skip.montanarolinkissue7198 messages
2010-07-28 17:19:35skip.montanarocreate