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
{{ message }}
Repository navigation
mypy crashes with python 3.14 within argparse #19150
When using python 3.14, mypy crashes right away. This is due the AugmentedHelpFormatter class in mypy which does not accept all arguments of argparse.HelpFormatter. In python 3.14,_get_formatter of argparse will pass prefix_chars which is not supported by AugmentedHelpFormatter.
Proposal: change the constructor of AugmentedHelpFormatter like
By the way, the same applies to the color keyword, which is passed as well
Traceback
File "venv314/lib/python3.14/site-packages/mypy/__main__.py", line 15, in console_entry
main()
~~~~^^
File "venv314/lib/python3.14/site-packages/mypy/main.py", line 88, in main
sources, options = process_options(args, stdout=stdout, stderr=stderr, fscache=fscache)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "venv314/lib/python3.14/site-packages/mypy/main.py", line 1055, in process_options
parser.add_argument(
~~~~~~~~~~~~~~~~~~~^
"--enable-incomplete-feature",
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<2 lines>...
help="Enable support of incomplete/experimental features for early preview",
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/data/.pyenv/versions/3.14.0b1/lib/python3.14/argparse.py", line 1562, in add_argument
formatter = self._get_formatter()
File "/data/.pyenv/versions/3.14.0b1/lib/python3.14/argparse.py", line 2729, in _get_formatter
return self.formatter_class(
~~~~~~~~~~~~~~~~~~~~^
prog=self.prog,
^^^^^^^^^^^^^^^
prefix_chars=self.prefix_chars,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
color=self.color,
^^^^^^^^^^^^^^^^^
)
^
TypeError: AugmentedHelpFormatter.__init__() got an unexpected keyword argument 'prefix_chars'.)
To Reproduce
setup a python 3.14 environment
run mypy --version
Your Environment
Mypy version used: 1.15.0
Mypy command-line flags: --version
Mypy configuration options from mypy.ini (and other config files): n/a
Activity
A5rocks commentedon May 26, 2025
This should be fixed by #19020 which should be in mypy 1.16
kasium commentedon May 26, 2025
Thanks a lot!
brianschubert commentedon Jun 21, 2025
Note for posterity: this was also patched upstream for 3.14.0b2+
python/cpython#133653