Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Error when running with --follow-imports=normal #16188

Closed
hima1701 opened this issue Sep 27, 2023 · 2 comments
Closed

Internal Error when running with --follow-imports=normal #16188

hima1701 opened this issue Sep 27, 2023 · 2 comments
Labels

Comments

@hima1701
Copy link

I was trying to run mypy on quite few number of files which imports other modules (quite a big repo), but this happens only when I use --follow-imports="normal" / "silent".

Crash Report
/Users/hima/Documents/Deliverect/Backend/venv/lib/python3.11/site-packages/pydantic/env_settings.py:22: error: INTERNAL ERROR

Traceback
Below is the traceback :

/Users/hima/Documents/Deliverect/Backend/venv/lib/python3.11/site-packages/pydantic/env_settings.py:22: 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.5.1
Traceback (most recent call last):
  File "mypy/semanal.py", line 6475, in accept
  File "mypy/nodes.py", line 1141, in accept
  File "mypy/semanal.py", line 1600, in visit_class_def
  File "mypy/semanal.py", line 1685, in analyze_class
  File "mypy/semanal.py", line 1714, in analyze_class_body_common
  File "mypy/semanal.py", line 1801, in apply_class_plugin_hooks
  File "pydantic/mypy.py", line 140, in pydantic.mypy.PydanticPlugin._pydantic_model_class_maker_callback
  File "pydantic/mypy.py", line 284, in pydantic.mypy.PydanticModelTransformer.transform
  File "pydantic/mypy.py", line 463, in pydantic.mypy.PydanticModelTransformer.add_construct_method
TypeError: __init__() missing required argument 'default' (pos 6)
/Users/hima/Documents/Deliverect/Backend/venv/lib/python3.11/site-packages/pydantic/env_settings.py:22: : note: use --pdb to drop into pdb
mypy --show-traceback  9.35s user 1.08s system 92% cpu 11.299 total

To Reproduce
Run mypy against a set of files which imports few other modules.

Your Environment
local

  • Mypy version used: 1.51 and 1.4.0
  • Mypy command-line flags: mypy against the repo or a set of files
  • Mypy configuration options from mypy.ini (and other config files): --follow-imports=normal
  • Python version used: 3.11
  • Operating system and version: MacOS and 13.6
@hima1701 hima1701 added the crash label Sep 27, 2023
@AlexWaygood
Copy link
Member

Duplicate of #15485. This is an issue with pydantic's mypy plugin that has already been fixed. You'll need to upgrade your pydantic version.

@AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2023
@hima1701
Copy link
Author

hima1701 commented Sep 27, 2023

Indeed fixed when pydantic has been updated to latest version, Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants