Bug 2424583 - python-autopage fails to build with Python 3.15: TypeError: ArgumentParser._get_formatter() got an unexpected keyword argument 'file' and one more
Summary: python-autopage fails to build with Python 3.15: TypeError: ArgumentParser._g...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-autopage
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Zane Bitter
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.15
TreeView+ depends on / blocked
 
Reported: 2025-12-23 12:56 UTC by Karolina Surma
Modified: 2026-01-30 16:07 UTC (History)
3 users (show)

Fixed In Version: python-autopage-0.6.0-1.fc44
Clone Of:
Environment:
Last Closed: 2026-01-30 16:06:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 2435448 0 unspecified CLOSED python-autopage-0.6.0 is available 2026-02-01 22:38:35 UTC

Description Karolina Surma 2025-12-23 12:56:52 UTC
python-autopage fails to build with Python 3.15.0a3.

There are two types of failures:

_________________ ArgumentParseTest.test_monkey_patch_no_color _________________

self = <autopage.tests.test_argparse.ArgumentParseTest testMethod=test_monkey_patch_no_color>

    def test_monkey_patch_no_color(self) -> None:
>       self.test_monkey_patch(color=False)

autopage/tests/test_argparse.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
autopage/tests/test_argparse.py:55: in test_monkey_patch
    self.test_argparse(argparse, color)
autopage/tests/test_argparse.py:36: in test_argparse
    parser.parse_args(['foo', '--help'])
/usr/lib64/python3.15/argparse.py:2053: in parse_args
    args, argv = self.parse_known_args(args, namespace)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib64/python3.15/argparse.py:2063: in parse_known_args
    return self._parse_known_args2(args, namespace, intermixed=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib64/python3.15/argparse.py:2092: in _parse_known_args2
    namespace, args = self._parse_known_args(args, namespace, intermixed)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib64/python3.15/argparse.py:2343: in _parse_known_args
    start_index = consume_optional(start_index)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib64/python3.15/argparse.py:2267: in consume_optional
    take_action(action, args, option_string)
/usr/lib64/python3.15/argparse.py:2168: in take_action
    action(self, namespace, argument_values, option_string)
autopage/argparse.py:133: in __call__
    parser.print_help(out)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = ArgumentParser(prog='pytest', usage=None, description=None, formatter_class=<class 'autopage.argparse.ColorHelpFormatter'>, conflict_handler='error', add_help=True)
file = <_io.TextIOWrapper encoding='utf8'>

    def print_help(self, file=None):
        if file is None:
            file = _sys.stdout
>       formatter = self._get_formatter(file=file)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       TypeError: ArgumentParser._get_formatter() got an unexpected keyword argument 'file'

/usr/lib64/python3.15/argparse.py:2809: TypeError
________________________ PagedStreamTest.test_defaults _________________________

self = <autopage.tests.test_autopage.PagedStreamTest testMethod=test_defaults>

    def test_defaults(self) -> None:
        class TestCommand(command.PagerCommand):
            def command(self) -> List[str]:
                return []
    
            def environment_variables(
                    self,
                    config: _PagerConfig) -> Optional[Dict[str, str]]:
                return None
    
        tc = TestCommand()
        ap = autopage.AutoPager(pager_command=tc, line_buffering=False)
        with mock.patch.object(ap, '_pager_env') as get_env, \
                mock.patch.object(tc, 'command') as cmd:
            stream = ap._paged_stream()
>           self.popen.assert_called_once_with(
                cmd.return_value,
                env=get_env.return_value,
                bufsize=-1,
                universal_newlines=True,
                encoding='UTF-8',
                errors='strict',
                stdin=subprocess.PIPE,
                stdout=None)

autopage/tests/test_autopage.py:56: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib64/python3.15/unittest/mock.py:997: in assert_called_once_with
    return self.assert_called_with(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MagicMock name='Popen' id='140352727747952'>
args = (<MagicMock name='command()' id='140352727749632'>,)
kwargs = {'bufsize': -1, 'encoding': 'UTF-8', 'env': <MagicMock name='_pager_env()' id='140352727749968'>, 'errors': 'strict', ...}
expected = call(<MagicMock name='command()' id='140352727749632'>, env=<MagicMock name='_pager_env()' id='140352727749968'>, bufsize=-1, universal_newlines=True, encoding='UTF-8', errors='strict', stdin=-1, stdout=None)
actual = call(<MagicMock name='command()' id='140352727749632'>, env=<MagicMock name='_pager_env()' id='140352727749968'>, bufsize=-1, universal_newlines=True, encoding='utf-8', errors='strict', stdin=-1, stdout=None)
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7fa66a6f38a0>
cause = None

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\n  Actual: %s'
                    % (expected, actual))
            raise AssertionError(error_message)
    
        def _error_message():
            msg = self._format_mock_failure_message(args, kwargs)
            return msg
        expected = self._call_matcher(_Call((args, kwargs), two=True))
        actual = self._call_matcher(self.call_args)
        if actual != expected:
            cause = expected if isinstance(expected, Exception) else None
>           raise AssertionError(_error_message()) from cause
E           AssertionError: expected call not found.
E           Expected: Popen(<MagicMock name='command()' id='140352727749632'>, env=<MagicMock name='_pager_env()' id='140352727749968'>, bufsize=-1, universal_newlines=True, encoding='UTF-8', errors='strict', stdin=-1, stdout=None)
E             Actual: Popen(<MagicMock name='command()' id='140352727749632'>, env=<MagicMock name='_pager_env()' id='140352727749968'>, bufsize=-1, universal_newlines=True, encoding='utf-8', errors='strict', stdin=-1, stdout=None)

/usr/lib64/python3.15/unittest/mock.py:985: AssertionError


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/09935275-python-autopage/

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

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 Zane Bitter 2026-01-09 23:11:47 UTC
https://github.com/zaneb/autopage/commit/2805288e84ca5985018372ee4b5b02b70c72ae95 fixes the second issue.

The first one is not reproducing with 3.15.0a2, so it must be due to a change in 3.15.0a3. I'll try to track that down and do a new release once it is resolved.

Comment 2 Zane Bitter 2026-01-30 03:58:23 UTC
All issues should be fixed in v0.6.0 https://pypi.org/project/autopage/0.6.0/
Tested with Python 3.15.0a5

Comment 3 Fedora Update System 2026-01-30 16:06:14 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-96ebbe21b3

Comment 4 Fedora Update System 2026-01-30 16:06:17 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 5 Fedora Update System 2026-01-30 16:06:21 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 6 Fedora Update System 2026-01-30 16:06:24 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 7 Fedora Update System 2026-01-30 16:06:27 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2026-01-30 16:06:30 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2026-01-30 16:06:33 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2026-01-30 16:06:36 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2026-01-30 16:06:39 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 12 Fedora Update System 2026-01-30 16:06:42 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2026-01-30 16:06:45 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2026-01-30 16:06:48 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 15 Fedora Update System 2026-01-30 16:06:51 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 16 Fedora Update System 2026-01-30 16:06:54 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 17 Fedora Update System 2026-01-30 16:06:56 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 18 Fedora Update System 2026-01-30 16:06:59 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 19 Fedora Update System 2026-01-30 16:07:01 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 20 Fedora Update System 2026-01-30 16:07:03 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 21 Fedora Update System 2026-01-30 16:07:06 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 22 Fedora Update System 2026-01-30 16:07:08 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 23 Fedora Update System 2026-01-30 16:07:11 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 24 Fedora Update System 2026-01-30 16:07:14 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 25 Fedora Update System 2026-01-30 16:07:16 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 26 Fedora Update System 2026-01-30 16:07:18 UTC
FEDORA-2026-96ebbe21b3 (python-autopage-0.6.0-1.fc44) has been pushed to the Fedora 44 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.