msherry / flycheck-pycheckers

Multiple syntax checker for Python in Emacs, using Flycheck
GNU General Public License v3.0
63 stars 23 forks source link

Pylint crashes not raised #6

Closed msherry closed 6 years ago

msherry commented 6 years ago

When pylint crashes, e.g with the following error:

Traceback (most recent call last):
  File "/Users/msherry/.virtualenvs/client/bin/pylint", line 11, in <module>
    sys.exit(run_pylint())
  File "/Users/msherry/.virtualenvs/client/lib/python2.7/site-packages/pylint/__init__.py", line 23, in run_pylint
    Run(sys.argv[1:])
  File "/Users/msherry/.virtualenvs/client/lib/python2.7/site-packages/pylint/lint.py", line 1273, in __init__
    'init-hook')))
  File "/Users/msherry/.virtualenvs/client/lib/python2.7/site-packages/pylint/lint.py", line 1374, in cb_init_hook
    exec(value) # pylint: disable=exec-used
  File "<string>", line 4, in <module>
  File "/Users/msherry/.virtualenvs/client/bin/../lib/python2.7/posixpath.py", line 122, in dirname
    i = p.rfind('/') + 1
AttributeError: 'NoneType' object has no attribute 'rfind'

it is not detected correctly. We should do a better job of differentiating between exit statuses due to lint problems vs. checker crashes.

msherry commented 6 years ago

The cause of this specific problem has to do with a bad init-hook section in the .pylintrc file being passed to pycheckers.py, and thence to pylint.

EDIT: it was actually related to pylint being unable to find its .pylintrc file within the context of the init-hook directive, despite being passed the --rcfile option. Also setting the PYLINTRC environment variable solved this particular issue.