You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.
(The problem has been spotted under OS X version of Atom and pylint from pip3, but may be applicable to other OSes).
To properly display the warnings/errors in Python lines containing the Unicode (UTF-8) strings, Pylint must be executed with proper locale for stdout. In command line, it is usually something like LANG=en_US.UTF-8 pylint, but the LANG part is usually omitted as it has some reasonable UTF-8 defaults.
When pylint is executed from under Atom/OS X, it seems though it is executed with presumed LANG=C. This causes any line containing UTF-8 characters and attempted to be reported by pylint, to break pylint, miserably. After pylint fails (with traceback), this traceback is promoted to linter-pylint and reported with huge red traceback popup; the overall result is that under OS X, if the Python code has any pylint-mentionable line which contains UTF-8 symbols, linter-pylint breaks.
Let's take the following file test.py (note the unnecessary space before the closing bracket of print()), and open it in Atom:
if __name__ == '__main__':
print("Привет, мир (Hello world in Russian)" )
If we open it in Atom which has linter-pylint available, this is what we receive:
This traceback can be reproduced from the command line, if we lint the file using LANG=C python3.5 which pylint test.py command line. But there will be no traceback, if we lint the file using LANG=UTF-8 python3.5 which pylint test.py.
The text was updated successfully, but these errors were encountered:
Marking this as a bug for now, I'm not sure if this is the proper place to fix this or if this should be escalated up to sb-exec, which is what eventually handles running pylint.
(The problem has been spotted under OS X version of Atom and pylint from pip3, but may be applicable to other OSes).
To properly display the warnings/errors in Python lines containing the Unicode (UTF-8) strings, Pylint must be executed with proper locale for stdout. In command line, it is usually something like
LANG=en_US.UTF-8 pylint
, but theLANG
part is usually omitted as it has some reasonable UTF-8 defaults.When pylint is executed from under Atom/OS X, it seems though it is executed with presumed
LANG=C
. This causes any line containing UTF-8 characters and attempted to be reported by pylint, to break pylint, miserably. After pylint fails (with traceback), this traceback is promoted to linter-pylint and reported with huge red traceback popup; the overall result is that under OS X, if the Python code has any pylint-mentionable line which contains UTF-8 symbols, linter-pylint breaks.This issue has been reported to pylint as well, at pylint-dev/pylint#859
Example
(Partially quotes the pylint-dev/pylint#859 )
Let's take the following file
test.py
(note the unnecessary space before the closing bracket ofprint()
), and open it in Atom:If we open it in Atom which has linter-pylint available, this is what we receive:
This traceback can be reproduced from the command line, if we lint the file using
LANG=C python3.5
which pylinttest.py
command line. But there will be no traceback, if we lint the file usingLANG=UTF-8 python3.5
which pylinttest.py
.The text was updated successfully, but these errors were encountered: