<#18512 Internal error in `mypy` during `pants che...
# github-notifications
c
#18512 Internal error in `mypy` during `pants check` Issue created by kaos Describe the bug Once every third blue moon I observe mypy crashing with "internal error" for perfectly valid sources. Pants version 2.16.0a0 (but have observed this since ~2.14 or before) OS Mac Additional info
Copy code
# from mypy sandbox
./__run.sh
src/.../x.py:205: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
<https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build>
Please report a bug at <https://github.com/python/mypy/issues>
version: 0.961
Traceback (most recent call last):
  File "mypy/checker.py", line 431, in accept
  File "mypy/nodes.py", line 747, in accept
  File "mypy/checker.py", line 782, in visit_func_def
  File "mypy/checker.py", line 793, in _visit_func_def
  File "mypy/checker.py", line 1500, in check_method_override
  File "mypy/checker.py", line 1528, in check_method_or_accessor_override_for_base
  File "mypy/checker.py", line 1614, in check_method_override_for_base_with_name
  File "mypy/checker.py", line 1776, in check_override
  File "mypy/messages.py", line 845, in signature_incompatible_with_supertype
  File "mypy/messages.py", line 867, in pretty_callable_or_overload
  File "mypy/messages.py", line 1979, in pretty_callable
AttributeError: attribute 'arguments' of 'FuncDef' undefined
src/.../x.py:205: : note: use --pdb to drop into pdb
Reading the comment in
__mypyrunner.sh
my suspicion falls on a corrupt mypy cache, as this issue goes away every time I wipe the pants caches and there are some trickery going on with it. The
cache.db
sqlite file seems to not be corrupt though. (as in it is usable, not sure about the state of the contents in the DB itself) Minimal work-around To preserve as much cache as possible, this wipes the mypy caches only:
Copy code
rm -rf ~/.cache/pants/named_caches/mypy_cache/
pantsbuild/pants