On Thu, 2 Apr 2009 at 07:23, Antoine Pitrou wrote:
Le mercredi 01 avril 2009 ?? 18:22 -0400, R. David Murray a ??crit :
I just added some tests to trunk that seem to indicate this case is
handled correctly in terms of preserving the data. Maybe you didn't
write the file such that the fields with the newlines were quoted?
I used the default csv.writer into a StringIO, and the whole was then
returned as the response of an HTTP request (with the proper
Content-Type and Content-Disposition headers). I assume quoting is
enabled by default?
Yes, it is. The files I've encountered that had embedded newlines I
never tried to open in Excel or any other spreadsheet, so all _I'm_
sure of is that Excel produces them.
And of course how non-Excel applications handle that data on import
can be different from how Excel handles it.
Of course, but when three major spreadsheet software (including Excel
itself) choke on the embedded newline, there might be a problem (or
not :)).
(please note that as for Excel I couldn't test myself, a client of mine
did)
I've made a note to test this, out of curiosity, when I get home.
--David
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com