SublimeLinter / SublimeLinter-pylint

SublimeLinter plugin for python, using pylint.
MIT License
116 stars 23 forks source link

SyntaxError: invalid token -- def _bypass_ensure_directory(name, mode=0777) #58

Open nodesocket opened 4 years ago

nodesocket commented 4 years ago

Passing the following to my SublimeLinter settings:

"linters": {
        "pylint": {
            "python": "/usr/local/bin/python3"
        }
}

Running Sublime Text 3.2.2

SublimeLinter: #3 pylint scriptrunner.py ERROR:
===============================================

Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/usr/local/lib/python3.7/site-packages/pylint/__init__.py", line 13, in <module>
    from pylint.checkers.similar import Run as SimilarRun
  File "/usr/local/lib/python3.7/site-packages/pylint/checkers/__init__.py", line 42, in <module>
    from pylint.checkers.base_checker import BaseChecker, BaseTokenChecker
  File "/usr/local/lib/python3.7/site-packages/pylint/checkers/base_checker.py", line 17, in <module>
    from pylint.config import OptionsProviderMixIn
  File "/usr/local/lib/python3.7/site-packages/pylint/config.py", line 49, in <module>
    from pylint import utils
  File "/usr/local/lib/python3.7/site-packages/pylint/utils/__init__.py", line 44, in <module>
    from pylint.utils.ast_walker import ASTWalker
  File "/usr/local/lib/python3.7/site-packages/pylint/utils/ast_walker.py", line 8, in <module>
    from astroid import nodes
  File "/usr/local/lib/python3.7/site-packages/astroid/__init__.py", line 63, in <module>
    from astroid.nodes import *
  File "/usr/local/lib/python3.7/site-packages/astroid/nodes.py", line 23, in <module>
    from astroid.node_classes import (
  File "/usr/local/lib/python3.7/site-packages/astroid/node_classes.py", line 38, in <module>
    from astroid import bases
  File "/usr/local/lib/python3.7/site-packages/astroid/bases.py", line 32, in <module>
    MANAGER = manager.AstroidManager()
  File "/usr/local/lib/python3.7/site-packages/astroid/util.py", line 26, in <lambda>
    lambda: importlib.import_module("." + module_name, "astroid")
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/usr/local/lib/python3.7/site-packages/astroid/manager.py", line 24, in <module>
    from astroid.interpreter._import import spec
  File "/usr/local/lib/python3.7/site-packages/astroid/interpreter/_import/spec.py", line 30, in <module>
    from . import util
  File "/usr/local/lib/python3.7/site-packages/astroid/interpreter/_import/util.py", line 4, in <module>
    import pkg_resources
  File "/Users/justin/.venvburrito/lib/python/distribute-0.6.35-py2.7.egg/pkg_resources.py", line 51
    def _bypass_ensure_directory(name, mode=0777):
                                               ^
SyntaxError: invalid token
kaste commented 4 years ago

I don't know what's going on here. Always good to set debug to true in the settings and watch the console. This way you get the actual command we're running here with the workingdir etc.

Maybe you can then replicate on the command line as well.

Really wonder why the last trace comes from a virtualenv, apparently a 2.7 egg.