Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Pylint is executed in an Unicode-incompatible way. #135

Closed
amyodov opened this issue Mar 29, 2016 · 3 comments · Fixed by #152
Closed

Pylint is executed in an Unicode-incompatible way. #135

amyodov opened this issue Mar 29, 2016 · 3 comments · Fixed by #152
Labels

Comments

@amyodov
Copy link

amyodov commented Mar 29, 2016

(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.

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 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:

image

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.

@Arcanemagus
Copy link
Member

Ah, yet another example of OSX breaking everything with their "Let's launch GUI applications with a blank environment" idea...

If you close all instances of Atom, and then launch Atom from a terminal (atom .), do you still see this breakage?

@amyodov
Copy link
Author

amyodov commented Apr 9, 2016

Arcanemagus, sorry for slow response.
When launching Atom from a terminal, it, predictably, doesn't have this issue.

@Arcanemagus Arcanemagus added the bug label May 5, 2016
@Arcanemagus
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants