django-rest-framework-csv
django-rest-framework-csv copied to clipboard
line breaks inside quoted fields are lost
When the CSV input contains line breaks inside quoted fields, like so:
c1,c2 foo,"bar baz"
the parser drops the interior line breaks, yielding
{ 'c1': 'foo', 'c2': 'barbaz' }
rather than the expected
{ 'c1': 'foo', 'c2': 'bar\r\nbaz' }
That's with Python 2.7.6, REST Framework 2.4.3, and Django 1.5.8 on Linux.
I was able to fix this by changing splitlines() to splitlines(True) in parsers.py.