Closed
Description
- Are you reporting a bug, or opening a feature request?
Bug report.
- Please insert below the code you are checking with mypy,
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
Here: https://github.com/tk0miya/sphinx/tree/mypy_py37_bug
This is our repository. Now I'm working to migrate type annotations to py3 style.
- What is the actual behavior/output?
mypy has been crashed with following stacktrace.
sphinx/util/docutils.py:61: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.641
Traceback (most recent call last):
File "/Users/tkomiya/.pyenv/versions/3.7.1/bin/mypy", line 11, in <module>
sys.exit(console_entry())
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/__main__.py", line 7, in console_entry
main(None)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/main.py", line 92, in main
res = build.build(sources, options, None, flush_errors, fscache)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/build.py", line 155, in build
result = _build(sources, options, alt_lib_path, flush_errors, fscache)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/build.py", line 204, in _build
graph = dispatch(sources, manager)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/build.py", line 2172, in dispatch
process_graph(graph, manager)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/build.py", line 2469, in process_graph
process_stale_scc(graph, scc, manager)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/build.py", line 2592, in process_stale_scc
graph[id].type_check_first_pass()
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/build.py", line 1730, in type_check_first_pass
self.type_checker().check_first_pass()
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/checker.py", line 282, in check_first_pass
self.accept(d)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/checker.py", line 393, in accept
stmt.accept(self)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/nodes.py", line 688, in accept
return visitor.visit_decorator(self)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/checker.py", line 3002, in visit_decorator
self.check_func_item(e.func, name=e.func.name())
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/checker.py", line 770, in check_func_item
self.check_func_def(defn, typ, name)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/checker.py", line 934, in check_func_def
self.accept(item.body)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/checker.py", line 393, in accept
stmt.accept(self)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/nodes.py", line 910, in accept
return visitor.visit_block(self)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/checker.py", line 1688, in visit_block
self.accept(s)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/checker.py", line 393, in accept
stmt.accept(self)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/nodes.py", line 1137, in accept
return visitor.visit_try_stmt(self)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/checker.py", line 2808, in visit_try_stmt
self.accept(s.finally_body)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/checker.py", line 393, in accept
stmt.accept(self)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/nodes.py", line 910, in accept
return visitor.visit_block(self)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/checker.py", line 1688, in visit_block
self.accept(s)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/checker.py", line 393, in accept
stmt.accept(self)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/nodes.py", line 965, in accept
return visitor.visit_assignment_stmt(self)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/checker.py", line 1696, in visit_assignment_stmt
self.check_assignment(s.lvalues[-1], s.rvalue, s.type is None, s.new_syntax)
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/checker.py", line 1751, in check_assignment
if self.check_compatibility_all_supers(lvalue, lvalue_type, rvalue):
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/checker.py", line 1822, in check_compatibility_all_supers
len(lvalue_node.info.bases) > 0):
File "/Users/tkomiya/.pyenv/versions/3.7.1/lib/python3.7/site-packages/mypy/nodes.py", line 2488, in __getattribute__
raise AssertionError(object.__getattribute__(self, 'msg'))
AssertionError: Var is lacking info
sphinx/util/docutils.py:61: : note: use --pdb to drop into pdb
- What is the behavior/output you expect?
Not crashed.
- What are the versions of mypy and Python you are using?
Do you see the same issue after installing mypy from Git master?
python 3.7.1 and 0.641.
I never tested with git master version.
- What are the mypy flags you are using? (For example --strict-optional)
Here is my setup.cfg:
[mypy]
show_column_numbers = True
show_error_context = True
ignore_missing_imports = True
follow_imports = skip
incremental = True
check_untyped_defs = True
warn_unused_ignores = True
strict_optional = False