pylint does not work with Python 3.7

Bug #1785080 reported by Benjamin Drung on 2018-08-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
astroid (Debian)
Fix Released
Unknown
astroid (Ubuntu)
Undecided
Unassigned
Cosmic
Undecided
Unassigned
pylint (Debian)
Fix Released
Unknown
pylint (Ubuntu)
High
Unassigned
Cosmic
High
Unassigned

Bug Description

In cosmic, Python 3.7 was added, but pylint does not work with it. Test case:

```
$ echo "print('test')" > test.py
$ # python3.7 -m pylint test.py
No config file found, using default configuration
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/astroid/decorators.py", line 89, in wrapped
    res = next(generator)
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/astroid/decorators.py", line 104, in wrapped
    raise StopIteration
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3/dist-packages/pylint/__main__.py", line 7, in <module>
    pylint.run_pylint()
  File "/usr/lib/python3/dist-packages/pylint/__init__.py", line 16, in run_pylint
    Run(sys.argv[1:])
  File "/usr/lib/python3/dist-packages/pylint/lint.py", line 1347, in __init__
    linter.check(args)
  File "/usr/lib/python3/dist-packages/pylint/lint.py", line 768, in check
    self._do_check(files_or_modules)
  File "/usr/lib/python3/dist-packages/pylint/lint.py", line 901, in _do_check
    self.check_astroid_module(ast_node, walker, rawcheckers, tokencheckers)
  File "/usr/lib/python3/dist-packages/pylint/lint.py", line 980, in check_astroid_module
    walker.walk(ast_node)
  File "/usr/lib/python3/dist-packages/pylint/utils.py", line 1011, in walk
    cb(astroid)
  File "/usr/lib/python3/dist-packages/pylint/checkers/base.py", line 1571, in visit_module
    self._check_docstring('module', node)
  File "/usr/lib/python3/dist-packages/pylint/checkers/base.py", line 1633, in _check_docstring
    func = utils.safe_infer(node.body[0].value.func)
  File "/usr/lib/python3/dist-packages/pylint/checkers/utils.py", line 826, in safe_infer
    next(inferit)
RuntimeError: generator raised StopIteration
```

tags: added: cosmic rls-cc-incoming
tags: removed: rls-cc-incoming
tags: added: id-5b6c6dabdb4b64402e84f627
Michael Hudson-Doyle (mwhudson) wrote :

The situation here is a little muddled because upstream has afaik decided to stop supporting Python 2. astroid needs an update, and the version of that that supports Python 3.7 definitely does not support Python 2 at all, so that will need to be split into two source packages. I can't quite tell if pylint (which needs an update separate to astroid) has followed the same path. If it has that will need a similar split too.

Changed in astroid (Debian):
status: Unknown → Confirmed
Mattia Rizzolo (mapreri) on 2018-09-26
Changed in astroid (Ubuntu Cosmic):
status: New → Fix Released
Changed in pylint (Ubuntu Cosmic):
status: New → Fix Released
Changed in pylint (Debian):
status: Unknown → Fix Released
Changed in astroid (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.