Skip to content

Conversation

@vibs29
Copy link

@vibs29 vibs29 commented Aug 18, 2025

RFC 4180 section 2.4 allows one or more fields (i.e. not zero). Given a three-record CSV file with one field per record, it's reasonable for it to have a blank second line indicating that the second record's only field is empty. Presently, this library reads that line as having no fields. There is no need for it to, since the RFC doesn't allow records with no fields. This patch fixes the library so that it correctly reads that second line as having one empty field.

This change is not backwards compatible. The earlier specification in test-happy-ending is for a file with nothing but three spaces to be read as having one record with no fields. I've changed that test specification to say that such a file will now be read in as having one record with one empty field.

RFC 4180 section 2.4 allows one or more fields (i.e. not zero). Given
a three-record CSV file with one field per record, it's reasonable for
it to have a blank second line indicating that the second record's only
field is empty. Presently, this library reads that line as having no
fields. There is no need for it to, since the RFC doesn't allow records
with no fields. This patch fixes the library so that it correctly reads
that second line as having one empty field.

This change is not backwards compatible. The earlier specification in
test-happy-ending is for a file with nothing but three spaces to be read
as having one record with no fields. I've changed that test specification
to say that such a file will now be read in as having one record with
one empty field.
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

Successfully merging this pull request may close these issues.

1 participant