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
running under python 3.13.1 results in the following crash when it does not crash under 3.12.8
Traceback
Traceback (most recent call last):
File "<redacted>/.venv/bin/mypy", line 8, in <module>
sys.exit(console_entry())
~~~~~~~~~~~~~^^
File "<redacted>/.venv/lib/python3.13/site-packages/mypy/__main__.py", line 15, in console_entry
main()
~~~~^^
File "mypy/main.py", line 109, in main
File "mypy/main.py", line 193, in run_build
File "mypy/build.py", line 194, in build
File "mypy/build.py", line 269, in _build
File "mypy/build.py", line 2940, in dispatch
File "mypy/build.py", line 3338, in process_graph
File "mypy/build.py", line 3433, in process_stale_scc
File "mypy/semanal_main.py", line 99, in semantic_analysis_for_scc
File "mypy/semanal_main.py", line 443, in apply_class_plugin_hooks
File "mypy/semanal_main.py", line 479, in apply_hooks_to_class
File "mypy/plugins/dataclasses.py", line 966, in dataclass_class_maker_callback
File "mypy/plugins/dataclasses.py", line 389, in transform
File "mypy/plugins/dataclasses.py", line 409, in _add_dunder_replace
File "mypy/plugins/common.py", line 238, in add_method_to_class
File "mypy/plugins/common.py", line 315, in _prepare_class_namespace
ValueError: list.remove(x): x not in list
To Reproduce
mypy <source dir>
Your Environment
This error occurs on a large proprietary code base. I have removed all custom configuration options and plugins normally specified in pyproject.toml, cleaned .mypy_cache dir and reproduced the error with a vanilla mypy invocation. No crash when using python 3.12.8, but traceback above occurs when switching to python 3.13.1
Mypy version used: 1.14.1
Mypy command-line flags: none
Mypy configuration options from mypy.ini (and other config files): none
Python version used: tested successfully under python 3.12.8, fails under 3.13.1
Operating system and version: OS X Sequoia
The text was updated successfully, but these errors were encountered:
ericbuehl
changed the title
Crash under Python 3.13: list.remove(x): x not in list
Crash under Python 3.13: ValueError: list.remove(x): x not in list
Jan 25, 2025
Thanks for the report @ericbuehl! Are you able to narrow the crash down to a particular file, ideally an example you can post here? Without it, this would be quite difficult to resolve.
For what it's worth, I know at least one large project which is also already running on 3.13.1 and hasn't encountered the crash yet.
Crash Report
running under python 3.13.1 results in the following crash when it does not crash under 3.12.8
Traceback
To Reproduce
mypy <source dir>
Your Environment
This error occurs on a large proprietary code base. I have removed all custom configuration options and plugins normally specified in pyproject.toml, cleaned .mypy_cache dir and reproduced the error with a vanilla mypy invocation. No crash when using python 3.12.8, but traceback above occurs when switching to python 3.13.1
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: