-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
unspecified-encoding
when using Path().read_text()
without encoding keyword argument
#5029
Labels
Milestone
Comments
GeZZu
added
Bug 🪲
Needs triage 📥
Just created, needs acknowledgment, triage, and proper labelling
labels
Sep 17, 2021
Based on the code in def write_text(self, data, encoding=None, errors=None):
"""
Open the file in text mode, write to it, and close the file.
"""
if not isinstance(data, str):
raise TypeError('data must be str, not %s' %
data.__class__.__name__)
with self.open(mode='w', encoding=encoding, errors=errors) as f:
return f.write(data) If I read the code correctly, you are passing |
I think it's for def read_text(self, encoding=None, errors=None):
"""
Open the file in text mode, read it, and close the file.
"""
with self.open(mode='r', encoding=encoding, errors=errors) as f:
return f.read() |
Pierre-Sassoulas
added
False Positive 🦟
A message is emitted but nothing is wrong with the code
and removed
Needs triage 📥
Just created, needs acknowledgment, triage, and proper labelling
labels
Sep 17, 2021
Pierre-Sassoulas
changed the title
unspecified-encoding when using Path().read_text() without encoding keyword argument
Sep 17, 2021
unspecified-encoding
when using Path().read_text()
without encoding keyword argument
My bad! Working on a fix now! |
DanielNoord
added a commit
to DanielNoord/pylint
that referenced
this issue
Sep 17, 2021
4 tasks
Pierre-Sassoulas
pushed a commit
that referenced
this issue
Sep 17, 2021
phst
added a commit
to phst/rules_elisp
that referenced
this issue
Nov 26, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug description
Configuration
No response
Command used
Pylint output
Expected behavior
No warnings are given when providing encoding without keyword.
Pylint version
OS / Environment
No response
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: