Skip to content

Python 3.14: TypeError: HelpFormatter.__init__() got an unexpected keyword argument 'prefix_chars' #3523

Closed
@The-Compiler

Description

@The-Compiler

Issue

With Python 3.14.0b1, tox immediately fails to start with TypeError: HelpFormatter.__init__() got an unexpected keyword argument 'prefix_chars', because it overrides HelpFormatter in an incompatible way.

This is due to:

See also:

Environment

Provide at least:

  • OS: Archlinux, Python 3.14.0b1
Output of pip list of the host Python, where tox is installed
cachetools    5.5.2
chardet       5.2.0
colorama      0.4.6
distlib       0.3.9
filelock      3.18.0
packaging     25.0
pip           25.1.1
platformdirs  4.3.8
pluggy        1.5.0
pyproject-api 1.9.0
tox           4.25.1.dev6+g4a8e50e2 /home/florian/tmp/tox
virtualenv    20.31.1

Output of running tox

Output of tox -rvv
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/florian/tmp/tox/src/tox/__main__.py", line 6, in <module>
    run()
    ~~~^^
  File "/home/florian/tmp/tox/src/tox/run.py", line 20, in run
    result = main(sys.argv[1:] if args is None else args)
  File "/home/florian/tmp/tox/src/tox/run.py", line 39, in main
    state = setup_state(args)
  File "/home/florian/tmp/tox/src/tox/run.py", line 53, in setup_state
    options = get_options(*args)
  File "/home/florian/tmp/tox/src/tox/config/cli/parse.py", line 39, in get_options
    parsed, cmd_handlers = _get_all(args)
                           ~~~~~~~~^^^^^^
  File "/home/florian/tmp/tox/src/tox/config/cli/parse.py", line 69, in _get_all
    tox_parser = _get_parser()
  File "/home/florian/tmp/tox/src/tox/config/cli/parse.py", line 76, in _get_parser
    tox_parser = ToxParser.core()  # load the core options
  File "/home/florian/tmp/tox/src/tox/config/cli/parser.py", line 300, in core
    return cls(
        prog=NAME,
    ...<3 lines>...
        description="create and set up environments to run command(s) in them",
    )
  File "/home/florian/tmp/tox/src/tox/config/cli/parser.py", line 149, in __init__
    super().__init__(*args, **kwargs)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/florian/tmp/tox/src/tox/config/cli/parser.py", line 39, in __init__
    super().__init__(*args, **kwargs)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.14/argparse.py", line 1920, in __init__
    self.add_argument(
    ~~~~~~~~~~~~~~~~~^
        default_prefix+'h', default_prefix*2+'help',
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        action='help', default=SUPPRESS,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        help=_('show this help message and exit'))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/florian/tmp/tox/src/tox/config/cli/parser.py", line 284, in add_argument
    result = super().add_argument(*args, **kwargs)
  File "/usr/lib/python3.14/argparse.py", line 1562, in add_argument
    formatter = self._get_formatter()
  File "/usr/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: HelpFormatter.__init__() got an unexpected keyword argument 'prefix_chars'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions