Skip to content

cmd2 crash running with Python 3.15.0a6 #1603

@tleonhardt

Description

@tleonhardt

Attempting to run any cmd2 app using the latest alpha version of Python 3.15, 3.15.0a6, results in a crash in our argparse_custom.py code.

The crash looks like:

    class ArgparseApp(cmd2.Cmd):
tests/test_argparse.py:58: in ArgparseApp
    tag_parser = cmd2.Cmd2ArgumentParser(description='create a html tag')
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cmd2/argparse_custom.py:1205: in __init__
    super().__init__(
../../../.local/share/uv/python/cpython-3.15.0a6-macos-aarch64-none/lib/python3.15/argparse.py:1992: in __init__
    self.add_argument(
cmd2/argparse_custom.py:801: in _add_argument_wrapper
    new_arg = orig_actions_container_add_argument(self, *args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../.local/share/uv/python/cpython-3.15.0a6-macos-aarch64-none/lib/python3.15/argparse.py:1625: in add_argument
    formatter = self._get_validation_formatter()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../.local/share/uv/python/cpython-3.15.0a6-macos-aarch64-none/lib/python3.15/argparse.py:2817: in _get_validation_formatter
    self._cached_formatter = self._get_formatter()
                             ^^^^^^^^^^^^^^^^^^^^^
cmd2/argparse_custom.py:1263: in _get_formatter
    return cast(Cmd2HelpFormatter, super()._get_formatter())
                                   ^^^^^^^^^^^^^^^^^^^^^^^^
../../../.local/share/uv/python/cpython-3.15.0a6-macos-aarch64-none/lib/python3.15/argparse.py:2810: in _get_formatter
    formatter._set_color(self.color, file=file)
E   TypeError: RichHelpFormatter._set_color() got an unexpected keyword argument 'file'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions