-
Notifications
You must be signed in to change notification settings - Fork 1.5k
csv: handle empty fields with skipinitialspace #8304
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -192,3 +192,11 @@ def test_quote_minimal_writer_empty_fields(): | |
|
|
||
|
|
||
| test_quote_minimal_writer_empty_fields() | ||
|
|
||
|
|
||
| def test_reader_skipinitialspace_preserves_quoted_spaces(): | ||
| reader = csv.reader(['a, "b, c", d'], skipinitialspace=True) | ||
| assert list(reader) == [["a", "b, c", "d"]] | ||
|
|
||
|
|
||
| test_reader_skipinitialspace_preserves_quoted_spaces() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isnt this test covered by test_read_skipinitialspace in test_csv? in that case, we don't need this test. could you check if it is that case or not?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
reader = csv.reader(['a, "b, c", d'], skipinitialspace=True)The implementation in 51a96d5 trimmed the input without respecting quote boundaries, causing the CPython incompatibility described in this review comment. so I added this regression case to |
||
Uh oh!
There was an error while loading. Please reload this page.