-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REGR: errors='replace' when encoding/errors are not specified #38997
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
Conversation
I would say replace only when encoding is Not set and inferred to utf-8. This should go back to 1.2.x |
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.
tests!
Should a follow-up PR intentionally revert this PR for 1.3? Personally, I would want to know when |
I don't think that content from skipped rows should matter and it should raise no error if the rest of the file is ok. Maybe you could add a test withouth skiprows, this raises on 1.1.5 which is good and should keep raising |
pandas/io/common.py
Outdated
@@ -553,8 +553,10 @@ def get_handle( | |||
Returns the dataclass IOHandles | |||
""" | |||
# Windows does not default to utf-8. Set to utf-8 for a consistent behavior | |||
encoding_not_specified = False |
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.
instead why don't you
encoding_passed, encoding = encoding, encoding or 'utf-i'
and then you can test encoding_passed is not None
its the same as you have but i think a bit more natural
I thought I don't think it is feasible to ignore encoding errors only for skipped rows. (We could read everything in binary mode but we would need to decode it to determine line endings.) |
This errors parameter is Not exposed |
yes, it isn't exposed. Sorry, that is what I meant to say :) |
thanks @twoertwein |
@meeseeksdev backport 1.2.x |
…rors are not specified
Something went wrong ... Please have a look at my logs. |
Thanks |
…ot specified (#39021) Co-authored-by: Torsten Wörtwein <[email protected]>
Should 1.3 use
errors='replace'
when noencoding/errors
are specified or useerrors=None
(strict)?