cassava
cassava copied to clipboard
Parse failure when CSV has trailing newline
As reported in https://github.com/begriffs/postgrest/issues/691
Lots of tools that generate CSV files add a trailing newline, so this behavior tends to be frustrating. I can work around it by using
head -c -1, but it'd be nice if I could just curl a CSV file without having to worry about it.
Would you be interested in me attempting to create a cassava pull request for this?
As a side note I started to look into making a pull request but had a problem running the tests. I cloned the project, was able to do stack init and stack build to build it, but stack test doesn't seem to run the test suite:
$ stack test
cassava-0.4.5.0: test (suite: unit-tests)
Either it's not running the tests or just not displaying the details of the test run. I see that the unit tests binary is created in ./.stack-work/dist/x86_64-osx/Cabal-1.24.0.0/build/unit-tests/unit-tests and when run directly it lists the passing tests. Not sure what's wrong with stack.
(bump)
Have you had a chance to look into this issue?
@hvr is this library still maintained?
@begriffs: @hvr has just merged a few PRs, so he'd probably be happy to accept one that fixes this issue.
Is this about corrupted/invalid CSV files being terminated by \r\n\n instead of \r\n?
No, it's not about mixing of \r and \n, just about a file ending in \n\n aka a blank line at the end. Technically that line is wrong because it doesn't have the right number of columns, but would be nice to ignore that incorrectness since some programs output files that way.