Bug 2458669 - python-rich-argparse fails to build with Python 3.15: 121 tests fail with TypeError: RichHelpFormatter._set_color() got an unexpected keyword argument 'file'
Summary: python-rich-argparse fails to build with Python 3.15: 121 tests fail with Typ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-rich-argparse
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Steve Traylen
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.15
TreeView+ depends on / blocked
 
Reported: 2026-04-15 12:47 UTC by Karolina Surma
Modified: 2026-04-15 21:08 UTC (History)
5 users (show)

Fixed In Version: python-rich-argparse-1.7.2-2.fc45
Clone Of:
Environment:
Last Closed: 2026-04-15 21:08:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2026-04-15 12:47:51 UTC
python-rich-argparse fails to build with Python 3.15.0a8.

121 tests fail with similar traceback:

________________________ test_richify_command_line_help ________________________

    def test_richify_command_line_help():
        from django.core.management.base import BaseCommand, DjangoHelpFormatter
    
        from rich_argparse.django import DjangoRichHelpFormatter, richify_command_line_help
    
        parser = BaseCommand().create_parser("", "")
        assert parser.formatter_class is DjangoHelpFormatter
    
        richify_command_line_help()
>       parser = BaseCommand().create_parser("", "")
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/test_django.py:35: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
rich_argparse/_patching.py:57: in wrapper
    return method(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^
tests/test_django.py:17: in create_parser
    return ArgumentParser(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib64/python3.15/argparse.py:1994: in __init__
    self.add_argument(
/usr/lib64/python3.15/argparse.py:1629: in add_argument
    formatter = self._get_validation_formatter()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib64/python3.15/argparse.py:2819: in _get_validation_formatter
    self._cached_formatter = self._get_formatter()
                             ^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = ArgumentParser(prog='', usage='', description=None, formatter_class=<class 'rich_argparse.django.DjangoRichHelpFormatter'>, conflict_handler='error', add_help=True)
file = None

    def _get_formatter(self, file=None):
        formatter = self.formatter_class(prog=self.prog)
>       formatter._set_color(self.color, file=file)
E       TypeError: RichHelpFormatter._set_color() got an unexpected keyword argument 'file'


https://docs.python.org/3.15/whatsnew/3.15.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.15/fedora-rawhide-x86_64/10327270-python-rich-argparse/

For all our attempts to build python-rich-argparse with Python 3.15, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/package/python-rich-argparse/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.15:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/

Let us know here if you have any questions.

Python 3.15 is planned to be included in Fedora 45.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.15.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Fedora Update System 2026-04-15 21:06:25 UTC
FEDORA-2026-97bbbced01 (python-rich-argparse-1.7.2-2.fc45) has been submitted as an update to Fedora 45.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-97bbbced01

Comment 2 Fedora Update System 2026-04-15 21:08:57 UTC
FEDORA-2026-97bbbced01 (python-rich-argparse-1.7.2-2.fc45) has been pushed to the Fedora 45 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.