-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
BUG: read_table and read_csv crash (#22748) #22750
BUG: read_table and read_csv crash (#22748) #22750
Conversation
Hello @troels! Thanks for submitting the PR.
|
b92bc82
to
6d5ecc7
Compare
Codecov Report
@@ Coverage Diff @@
## master #22750 +/- ##
==========================================
+ Coverage 92.18% 92.18% +<.01%
==========================================
Files 169 169
Lines 50812 50820 +8
==========================================
+ Hits 46842 46850 +8
Misses 3970 3970
Continue to review full report at Codecov.
|
6d5ecc7
to
b7ddc09
Compare
t = TextIOWrapper(b, encoding='ascii', errors='surrogateescape') | ||
with pytest.raises(UnicodeEncodeError): | ||
pd.read_csv(t) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when you run this test against the Python engine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gfyoung
I've moved this to common.py now. I guess that even if the interpreter crash is only reproducible in the c-parser, the parsers should behave the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is correct. Rarely do we have tests that specific to a given parser, unless the parser does not support the behavior we are testing.
b7ddc09
to
55e6e43
Compare
tiny change. ping on green. @gfyoung merge when pushed and green. |
55e6e43
to
93fb9d5
Compare
A missing null-pointer check made read_table and read_csv prone to crash on badly encoded text. Add null-pointer check.
Thanks @troels ! |
A missing null-pointer check made read_table and read_csv prone to crash on badly encoded text. Add null-pointer check. Closes pandas-devgh-22748.
A missing null-pointer check made read_table and read_csv prone
to crash on badly encoded text. Add null-pointer check.
git diff upstream/master -u -- "*.py" | flake8 --diff