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
csv.Sniffer.sniff() regex error #74343
Comments
Line 220 of Lib/csv.py has an extra r'(?P<delim>>[^\\w\\n"\\']) |
What is the consequence of this change? Does it change the syntax of the parser? Which kind of format wasn't parsed correctly? |
There are 4 patterns. They try to determine the delimiter and quote by looking for matches. Each pattern supposedly covers one of 4 cases:
On that basis, case 3 looks wrong because the pattern for delimiter is:
instead of the expected:
Looks like a bug to me. |
Can you please try to write a unit test to check for non-regression? Or at least give an example? |
If it is a bug that indicates there is at least one missing unit test :) Maybe the OP will contribute a test. |
Will do! I will try to get a regression proof test into test_csv.py in the next 24 hours. Essentially I will make sure that the sniffer returns a positive match for each of the patterns that the regex is intended to hit. |
I've added some unittests for Sniffer._guess_quote_and_delimiter(); they should prevent regression. |
Thank you for your contribution Jake! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: