You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If MYPYPATH is set to the directory I'm checking, once mypy finds an error it crashes with INTERNAL ERROR.
Here are the files to reproduce:
scripts/__init__.py: empty file scripts/a.py:
"asdf"+10
scripts/b.py:
importa
Command line:
MYPYPATH=scripts mypy scripts
What is the actual behavior/output?
scripts/a.py:1: error: Unsupported operand types for + ("str" and "int")
scripts/a.py:1: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.670
scripts/a.py:1: : note: please use --show-traceback to print a traceback when reporting a bug
What is the behavior/output you expect?
The error (unsupported operand types) should be reported, but mypy shouldn't crash afterwards.
What are the versions of mypy and Python you are using?
Python 3.7.2
mypy 0.670
Do you see the same issue after installing mypy from Git master?
If mypy crashed with a traceback, please paste
the full traceback below.
Traceback (most recent call last):
File "/xxxx/.virtualenvs/xxxx/bin/mypy", line 10, in <module>
sys.exit(console_entry())
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/__main__.py", line 7, in console_entry
main(None)
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/main.py", line 91, in main
res = build.build(sources, options, None, flush_errors, fscache)
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/build.py", line 162, in build
result = _build(sources, options, alt_lib_path, flush_errors, fscache)
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/build.py", line 217, in _build
graph = dispatch(sources, manager)
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/build.py", line 2360, in dispatch
process_graph(graph, manager)
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/build.py", line 2660, in process_graph
process_stale_scc(graph, scc, manager)
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/build.py", line 2767, in process_stale_scc
graph[id].type_check_first_pass()
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/build.py", line 1919, in type_check_first_pass
self.type_checker().check_first_pass()
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/checker.py", line 282, in check_first_pass
self.accept(d)
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/checker.py", line 393, in accept
stmt.accept(self)
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/nodes.py", line 926, in accept
return visitor.visit_expression_stmt(self)
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/checker.py", line 2635, in visit_expression_stmt
self.expr_checker.accept(s.expr, allow_none_return=True, always_allow_any=True)
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/checkexpr.py", line 3188, in accept
typ = node.accept(self)
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/nodes.py", line 1627, in accept
return visitor.visit_op_expr(self)
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/checkexpr.py", line 1884, in visit_op_expr
allow_reverse=True)
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/checkexpr.py", line 2270, in check_op
self.msg.add_errors(msg)
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/messages.py", line 99, in add_errors
self.errors.add_error_info(info)
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/errors.py", line 286, in add_error_info
self._add_error_info(file, info)
File "/xxxx/.virtualenvs/xxxx/lib/python3.7/site-packages/mypy/errors.py", line 268, in _add_error_info
assert file not in self.flushed_files
AssertionError:
The text was updated successfully, but these errors were encountered:
The fact that we crash instead of producing an error message is a bug here, but the issue is that the file a.py is being picked twice with different module names, since it appears both on the command line and in mypy_path.
If
MYPYPATH
is set to the directory I'm checking, once mypy finds an error it crashes withINTERNAL ERROR
.Here are the files to reproduce:
scripts/__init__.py
: empty filescripts/a.py
:scripts/b.py
:Command line:
What is the actual behavior/output?
What is the behavior/output you expect?
The error (unsupported operand types) should be reported, but mypy shouldn't crash afterwards.
What are the versions of mypy and Python you are using?
Python 3.7.2
mypy 0.670
Do you see the same issue after installing mypy from Git master?
Yes (version 0.680+dev.ce78d65d68cdd6899e7bc5c25e9f583d76520c50)
If mypy crashed with a traceback, please paste
the full traceback below.
The text was updated successfully, but these errors were encountered: