mypy icon indicating copy to clipboard operation
mypy copied to clipboard

MyPy crash with message: rror: INTERNAL ERROR -- Please try using mypy master on GitHub

Open alywonder opened this issue 1 year ago • 1 comments

Crash Report

When I run mypy on my project, it crashes with the following messages: copi/types/model.py:124: error: INTERNAL ERROR -- Please try using mypy master on GitHub: https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build If this issue continues with mypy master, please report a bug at https://github.com/python/mypy/issues version: 1.9.0 copi/types/model.py:124: : note: please use --show-traceback to print a traceback when reporting a bug type: exit 2 (3.78 seconds) /Users/al/Projects/spaces/smighty-ws/copi> poetry run mypy copi pid=58291 type: FAIL code 2 (6.17=setup[0.12]+cmd[2.27,3.78] seconds) evaluation failed :( (6.42 seconds)

I ran it just on one module with traceback on as follows: mypy --show-traceback -m copi.types.model

The traceback is copied below.

Traceback

/Users/al/Projects/spaces/smighty-ws/copi/copi/types/model.py:124: 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: 1.9.0
Traceback (most recent call last):
  File "mypy/semanal.py", line 6550, in accept
  File "mypy/nodes.py", line 787, in accept
  File "mypy/semanal.py", line 833, in visit_func_def
  File "mypy/semanal.py", line 868, in analyze_func_def
  File "mypy/semanal.py", line 6222, in defer
AssertionError: Must not defer during final iteration
/Users/al/Projects/spaces/smighty-ws/copi/copi/types/model.py:124: : note: use --pdb to drop into pdb

To Reproduce

It happens every single time. I was using mypy version 1.8 before. Just upgraded to 1.9 and still getting the same crash.

Your Environment

MacOS Sonoma Version 14.4.1

  • Mypy version used: 1.9.0
  • Mypy command-line flags: None
  • Mypy configuration options for mypy in pyproject.toml [tool.mypy] plugins = [ "pydantic.mypy" ] exclude = [ "^test", "tests/" ] strict = true follow_imports = "silent" warn_unused_ignores = false

[tool.pydantic-mypy] init_forbid_extra = true init_typed = true warn_required_dynamic_aliases = true

  • Python version used: 3.10.9
  • Operating system and version: MacOS Sonoma Version 14.4.1

alywonder avatar Apr 05 '24 12:04 alywonder

I ran into the exact same issue and identical trace! For me, this crash started happening when we tried to bump Pydantic from 2.5.3 to 2.7.1. I saw this crash with both Mypy 1.7 and 1.9 (I didn't try 1.8).

micahstairs avatar Apr 24 '24 13:04 micahstairs

Closing since there isn't a repro. Feel free to re-open if you can make one. Also worth checking if you still get the crash if you remove the pydantic plugin for mypy

hauntsaninja avatar Jun 21 '24 09:06 hauntsaninja