Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

line breaks inside quoted fields are lost #24

Open
amc1804 opened this issue Dec 5, 2014 · 0 comments
Open

line breaks inside quoted fields are lost #24

amc1804 opened this issue Dec 5, 2014 · 0 comments

Comments

@amc1804
Copy link

amc1804 commented Dec 5, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant