-
Notifications
You must be signed in to change notification settings - Fork 20
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
Can't call ftcsv.parse with a string twice in a row #39
Comments
Seems to affect things loaded by string, but not things loaded via files. So this will cause an error: local options = {loadFromString=true, ignoreQuotes=true}
local a = ftcsv.parse('a,b,c\n"apple,banana,carrot', ",", options)
print(a[1].a)
a = ftcsv.parse('a,b,c\n"apple,banana,carrot', ",", options)
print(a[1].a) but this wont: local a = ftcsv.parse("ALLUSERS.csv", ",")
print(a[1].Name)
a = ftcsv.parse("ALLUSERS.csv", ",")
print(a[1].Name) |
I ran into the same problems when I was performing unit tests on ftcsv in a private repo. Some of the libraries required by ftcsv had their versions bumped higher and that MIGHT be the cause of the problem. |
I think it happens because ftcsv modifies the original if options.bufferSize == nil then
options.bufferSize = 2^16 so when the options table gets used again, it is then present. Interesting. I guess I've never ran into it in use because I usually inline the options table instead of re-using it. I mostly did it in the docs to make it easier to read. I'll probably play arond with all of this some more tomorrow and see what can be done. |
The repo I was using was a direct c/p of all the code with no modifications and it was still failing unit tests. At first it was due to GitHub switching all new repos to use I also added you as a collaborator so you can see for yourself. |
Yeah, it seemed to be the buffserSize value being set. I re-ordered the logic a bit in the argument parsing, so bufferSize wont get set when using The code is in https://github.com/FourierTransformer/ftcsv/tree/optional-delimiter if you want to check it out! It also has the changes from #37 |
Looks good! I am planning to work on beefing up your CI/CD with GitHub Actions so it runs smoother for the repo. Going to add a linter and automated doc generator via code comments. Expect several new pull requests over this week. If you have any questions, feel free to ping me here or on discord. |
As nice as that offer is, I'm good with the setup that I have. It works for me as a single dev and I like the minimalism. Since this isn't a repo with a lot of activity (mostly just the odd bugfix or feature here and there), and I'm planning to support this indefinitely, I need to be able to maintain it with a low level of friction. |
I ran into this in the REPL while looking at #37
Gonna see if it affects actual scripts
The text was updated successfully, but these errors were encountered: