Bug 2458672

Summary: python-streamlink fails to build with Python 3.15: test_help_color: TypeError: TestPrint._color.<locals>.<lambda>() got an unexpected keyword argument 'file'
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-streamlinkAssignee: Mohamed El Morabity <pikachu.2014>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: ksurma, mhroncok, pikachu.2014
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2412434    

Description Karolina Surma 2026-04-15 12:52:00 UTC
python-streamlink fails to build with Python 3.15.0a8.

___________ ERROR at setup of TestPrint.test_help_color[argv0-True] ____________

self = <tests.cli.main.test_logging.TestPrint object at 0x7fd9c27b96e0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fd9c1ba27b0>
capsys = <_pytest.capture.CaptureFixture object at 0x7fd9c1a78ad0>
session = <streamlink.session.session.Streamlink object at 0x7fd9bf0ac290>

    @pytest.fixture()
    def stdout(self, monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture, session: Streamlink):
        mock_resolve_url = Mock()
        monkeypatch.setattr(session, "resolve_url", mock_resolve_url)
    
        with pytest.raises(SystemExit) as cm:
>           streamlink_cli.main.main()

tests/cli/main/test_logging.py:676: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/cli/main/conftest.py:35: in _main
    return original_main()
           ^^^^^^^^^^^^^^^
../BUILDROOT/usr/lib/python3.15/site-packages/streamlink_cli/main.py:1030: in main
    exit_code = run(parser)
                ^^^^^^^^^^^
../BUILDROOT/usr/lib/python3.15/site-packages/streamlink_cli/main.py:1004: in run
    helptext = parser.format_help()
               ^^^^^^^^^^^^^^^^^^^^
../BUILDROOT/usr/lib/python3.15/site-packages/streamlink_cli/argparser.py:124: in format_help
    formatter = self._get_formatter()
                ^^^^^^^^^^^^^^^^^^^^^
/usr/lib64/python3.15/argparse.py:2812: in _get_formatter
    formatter._set_color(self.color, file=file)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <streamlink_cli.argparser.HelpFormatter object at 0x7fd9c22d0e90>
color = True

    def _set_color(self, color, *, file=None):
        from _colorize import can_colorize, decolor, get_theme
    
>       if color and can_colorize(file=file):
                     ^^^^^^^^^^^^^^^^^^^^^^^
E       TypeError: TestPrint._color.<locals>.<lambda>() 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/10318835-python-streamlink/

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

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.