Suggestions for workaround in CSV bug

Michael Ströder michael at
Tue Jan 24 09:32:14 CET 2006

Simmons, Stephen wrote:
> I've come across a bug in CSV where the csv.reader() raises an 
> exception if the input line contains '\r'. Example code and output
> below shows a test case where csv.reader() cannot read an array
> written by csv.writer(). 
> Error: newline inside string
> WARNING: Failure executing file: <>

Did you play with the csv.Dialect setting lineterminator='\n' ?

csv.reader(file(name, 'rb'),lineterminator='\n)

See also:

Ciao, Michael.

More information about the Python-list mailing list