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 sjmachin
Recipients georg.brandl, jaywalker, jdwhitley, pitrou, sjmachin, skip.montanaro, vstinner
Date 2009-03-09.06:49:05
SpamBayes Score 2.0110572e-06
Marked as misclassified No
Message-id <1236581351.09.0.0878535306965.issue4847@psf.upfronthosting.co.za>
In-reply-to
Content
... and it looks like Option 2 might already *almost* be in place.
Continuing with the previous example (book1.csv has embedded lone LFs):

C:\devel\csv>\python30\python -c "import csv;
print(repr(list(csv.reader(open('book1.csv','rt', encoding='ascii')))))"
[['Field1', 'Field 2 has a\nvery long\nheading', 'Field3'], ['1.11',
'2.22', '3.33']]

Looks good. However consider book2.csv which has embedded CRLFs:
C:\devel\csv>\python30\python -c "print(repr(open('book2.csv',
'rb').read()))"
b'Field1,"Field 2 has a\r\nvery
long\r\nheading",Field3\r\n1.11,2.22,3.33\r\n'

This gives:
C:\devel\csv>\python30\python -c "import csv;
print(repr(list(csv.reader(open('book2.csv','rt', encoding='ascii')))))"
[['Field1', 'Field 2 has a\nvery long\nheading', 'Field3'], ['1.11',
'2.22', '3.33']]

Not good. It should preserve ALL characters in the field.
History
Date User Action Args
2009-03-09 06:49:13sjmachinsetrecipients: + sjmachin, skip.montanaro, georg.brandl, pitrou, vstinner, jaywalker, jdwhitley
2009-03-09 06:49:11sjmachinsetmessageid: <1236581351.09.0.0878535306965.issue4847@psf.upfronthosting.co.za>
2009-03-09 06:49:08sjmachinlinkissue4847 messages
2009-03-09 06:49:06sjmachincreate