Skip to content
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

Pyflakes, Pylint fail on Python 3.6 #200

Closed
Alir3z4 opened this issue Jan 7, 2017 · 9 comments
Closed

Pyflakes, Pylint fail on Python 3.6 #200

Alir3z4 opened this issue Jan 7, 2017 · 9 comments

Comments

@Alir3z4
Copy link

Alir3z4 commented Jan 7, 2017

$ prospector --uses django
Messages
========

.
  Line: None
    pyflakes: failure / Tool pyflakes failed to run (exception was raised)
    pylint: failure / Tool pylint failed to run (exception was raised



Check Information
=================
         Started: 2017-01-07 20:13:13.604470
        Finished: 2017-01-07 20:13:30.420510
      Time Taken: 16.82 seconds
       Formatter: grouped
        Profiles: .prospector.yml, doc_warnings, strictness_veryhigh, no_member_warnings
      Strictness: from profile
  Libraries Used: django
       Tools Run: pep257, pep8, profile-validator, pyflakes, pylint
  Messages Found: 2

Version:

prospector --version
prospector 0.12.4
@carlio
Copy link
Contributor

carlio commented Jan 7, 2017

@Alir3z4 Funnily enough I was just investigating that! Could you re-run it with the -X flag to get the stack trace for the exception? I think this is a problem in astroid.

@Alir3z4
Copy link
Author

Alir3z4 commented Jan 7, 2017

@carlio Thanks for the quick response.

Here's the result:

(projx) [alireza@arch projx]$ prospector -X  --uses django

Traceback (most recent call last):
  File "/home/alireza/.virtualenvs/projx/bin/prospector", line 11, in <module>
    sys.exit(main())
  File "/home/alireza/.virtualenvs/projx/lib/python3.6/site-packages/prospector/run.py", line 165, in main
    prospector.execute()
  File "/home/alireza/.virtualenvs/projx/lib/python3.6/site-packages/prospector/run.py", line 66, in execute
    messages += tool.run(found_files)
  File "/home/alireza/.virtualenvs/projx/lib/python3.6/site-packages/prospector/tools/pyflakes/__init__.py", line 131, in run
    checkPath(filepath, reporter)
  File "/home/alireza/.virtualenvs/projx/lib/python3.6/site-packages/pyflakes/api.py", line 108, in checkPath
    return check(codestr, filename, reporter)
  File "/home/alireza/.virtualenvs/projx/lib/python3.6/site-packages/pyflakes/api.py", line 69, in check
    w = checker.Checker(tree, filename)
  File "/home/alireza/.virtualenvs/projx/lib/python3.6/site-packages/pyflakes/checker.py", line 495, in __init__
    self.runDeferred(self._deferredFunctions)
  File "/home/alireza/.virtualenvs/projx/lib/python3.6/site-packages/pyflakes/checker.py", line 532, in runDeferred
    handler()
  File "/home/alireza/.virtualenvs/projx/lib/python3.6/site-packages/pyflakes/checker.py", line 1160, in runFunction
    self.handleNode(stmt, node)
  File "/home/alireza/.virtualenvs/projx/lib/python3.6/site-packages/pyflakes/checker.py", line 862, in handleNode
    handler = self.getNodeHandler(node.__class__)
  File "/home/alireza/.virtualenvs/projx/lib/python3.6/site-packages/pyflakes/checker.py", line 696, in getNodeHandler
    self._nodeHandlers[node_class] = handler = getattr(self, nodeType)
AttributeError: 'Checker' object has no attribute 'ANNASSIGN'

@reidransom
Copy link

I'm also seeing pylint: failure / Tool pylint failed to run (exception was raised) after upgrading to python 3.6.0.

$ prospector --strictness verylow --die-on-tool-error
Traceback (most recent call last):
  File "/Users/reid/src/LCMS/venv/bin/prospector", line 11, in <module>
    load_entry_point('prospector==0.12.4', 'console_scripts', 'prospector')()
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/prospector/run.py", line 165, in main
    prospector.execute()
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/prospector/run.py", line 66, in execute
    messages += tool.run(found_files)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/prospector/tools/pylint/__init__.py", line 232, in run
    self._linter.check(self._args)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/pylint/lint.py", line 732, in check
    self._do_check(files_or_modules)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/pylint/lint.py", line 863, in _do_check
    self.check_astroid_module(ast_node, walker, rawcheckers, tokencheckers)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/pylint/lint.py", line 944, in check_astroid_module
    walker.walk(ast_node)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/pylint/utils.py", line 944, in walk
    self.walk(child)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/pylint/utils.py", line 944, in walk
    self.walk(child)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/pylint/utils.py", line 944, in walk
    self.walk(child)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/pylint/utils.py", line 941, in walk
    cb(astroid)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/pylint/checkers/typecheck.py", line 516, in visit_call
    called, implicit_args, callable_name = _determine_callable(called)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/pylint/checkers/typecheck.py", line 205, in _determine_callable
    return callable_obj, 0, callable_obj.type
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/decorators.py", line 73, in __get__
    val = self.wrapped(inst)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/scoped_nodes.py", line 811, in type
    current = next(node.func.infer())
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/bases.py", line 302, in wrapped
    for res in _func(node, context, **kwargs):
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/bases.py", line 99, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/context.py", line 49, in cache_generator
    for result in generator:
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/bases.py", line 302, in wrapped
    for res in _func(node, context, **kwargs):
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/inference.py", line 142, in infer_import_from
    module = self.do_import_module()
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/mixins.py", line 129, in do_import_module
    relative_only=level and level >= 1)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/scoped_nodes.py", line 492, in import_module
    return MANAGER.ast_from_module_name(absmodname)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/manager.py", line 136, in ast_from_module_name
    return self.ast_from_file(filepath, modname, fallback=False)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/manager.py", line 86, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/builder.py", line 141, in file_build
    module = self._data_build(data, modname, path)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/builder.py", line 185, in _data_build
    module = builder.visit_module(node, modname, node_file, package)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 154, in visit_module
    newnode.body = [self.visit(child, newnode) for child in node.body]
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 154, in <listcomp>
    newnode.body = [self.visit(child, newnode) for child in node.body]
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 167, in visit
    return visit_method(node, parent, assign_ctx)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 957, in visit_classdef
    newnode = super(TreeRebuilder3k, self).visit_classdef(node, parent, assign_ctx)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 357, in visit_classdef
    for child in node.body]
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 357, in <listcomp>
    for child in node.body]
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 167, in visit
    return visit_method(node, parent, assign_ctx)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 543, in visit_functiondef
    assign_ctx=assign_ctx)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 528, in _visit_functiondef
    for child in node.body]
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 528, in <listcomp>
    for child in node.body]
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 167, in visit
    return visit_method(node, parent, assign_ctx)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 447, in visit_expr
    newnode.value = self.visit(node.value, newnode, assign_ctx)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 167, in visit
    return visit_method(node, parent, assign_ctx)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 315, in visit_call
    for child in node.args]
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 315, in <listcomp>
    for child in node.args]
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 167, in visit
    return visit_method(node, parent, assign_ctx)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 549, in visit_generatorexp
    newnode.elt = self.visit(node.elt, newnode, assign_ctx)
  File "/Users/reid/src/LCMS/venv/lib/python3.6/site-packages/astroid/rebuilder.py", line 165, in visit
    visit_method = getattr(self, visit_name)
AttributeError: 'TreeRebuilder3k' object has no attribute 'visit_joinedstr'

@danielward
Copy link

It's worth noting that this works with the latest (master) version of astroid (1.5.0), however prospector currently enforces a previous version (1.4.9) of astroid. Frustratingly, this failure occurs even when pylint is a disabled module.

@roversch
Copy link

Same here. Any workaround available?

@benoitc
Copy link

benoitc commented Jan 8, 2018

seems it doesn't work with astroid 1.6.0 , has anyone tried this version?

@chocoelho
Copy link
Contributor

Closing this since we're not enforcing an old version of astroid anymore and this issue is no longer happening.

@C0DK
Copy link

C0DK commented Jul 14, 2019

Not to reopen an old question, but i seem to get it as well.


Messages
========

.
  Line: None
    pylint: failure / Tool pylint failed to run (exception was raised)
...

Check Information
=================
         Started: 2019-07-14 09:42:37.320949
        Finished: 2019-07-14 09:42:41.348163
      Time Taken: 4.03 seconds
       Formatter: grouped
        Profiles: .prospector.yaml, full_pep8, strictness_veryhigh, no_doc_warnings, no_member_warnings, no_test_warnings
      Strictness: from profile
  Libraries Used: django
       Tools Run: dodgy, mccabe, pep8, profile-validator, pyflakes, pylint
  Messages Found: 19

with version prospector 1.1.6.4 on my django project.

@GregHilston
Copy link

Same situation. Using image python:3.6.0-slim with prospector 1.1.6.4 and also getting this issue

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

No branches or pull requests

9 participants