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 jaywalker
Recipients jaywalker, vstinner
Date 2009-01-05.17:29:53
SpamBayes Score 0.18630359
Marked as misclassified No
Message-id <279018.16745.qm@web111108.mail.gq1.yahoo.com>
In-reply-to
Content
make it '\r\n', if you want. Such files can be easily generated on windows text editors, or even linux ones nowadays. Upon reading, if the file is opened in text mode, this will probably be converted to \n even on linux by python (I may be wrong). Thus, \r gets lost.

Not a biggie, but you never know ;0)

----- Original Message ----
From: STINNER Victor <report@bugs.python.org>
To: jaywalkie@yahoo.com
Sent: Monday, January 5, 2009 12:23:45 PM
Subject: [issue4847] csv fails when file is opened in binary mode

STINNER Victor <victor.stinner@haypocalc.com> added the comment:

> say one of the fields has an embedded \r. For instance "blahblah\r" is the
> value of the first column. Now open this file in text mode. What happens to
> this '\r' even before csv.reader sees it?

I used rarely the CSV format, but it sounds strange to have a newline 
character in a column. Newlines characters (\r and \n) are reserved to mark 
the end of the line. Can you produce such file to test? :-)

I guess that the csv modules does something like readline().split(";").

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue4847>
_______________________________________
History
Date User Action Args
2009-01-05 17:29:54jaywalkersetrecipients: + jaywalker, vstinner
2009-01-05 17:29:53jaywalkerlinkissue4847 messages
2009-01-05 17:29:53jaywalkercreate