Bug 2481412 - osc fails to build with Python 3.15: TypeError: OscArgumentParser._get_formatter() got an unexpected keyword argument 'file'
Summary: osc fails to build with Python 3.15: TypeError: OscArgumentParser._get_format...
Keywords:
Status: POST
Alias: None
Product: Fedora
Classification: Fedora
Component: osc
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dan Čermák
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.15
TreeView+ depends on / blocked
 
Reported: 2026-05-26 09:54 UTC by Karolina Surma
Modified: 2026-05-27 19:29 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2026-05-26 09:54:38 UTC
osc fails to build with Python 3.15.0b1.

ERROR: test_unknown_options (tests.test_commandline.TestCommandClasses.test_unknown_options)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/osc-1.26.0-build/osc-1.26.0/tests/test_commandline.py", line 126, in test_unknown_options
    self.assertRaises(SystemExit, main.parse_args, ["test-cmd", "--unknown-option"])
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.15/unittest/case.py", line 835, in assertRaises
    return context.handle('assertRaises', args, kwargs)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.15/unittest/case.py", line 245, in handle
    callable_obj(*args, **kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/osc-1.26.0-build/osc-1.26.0/osc/commandline_common.py", line 295, in parse_args
    self.parser.error(f"unrecognized arguments: " + " ".join(unrecognized))
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.15/argparse.py", line 2918, in error
    self.print_usage(_sys.stderr)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/lib64/python3.15/argparse.py", line 2864, in print_usage
    formatter = self._get_formatter(file=file)
TypeError: OscArgumentParser._get_formatter() 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-b1/fedora-rawhide-x86_64/10510089-osc/

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

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-b1/

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 Nathan 2026-05-26 14:11:56 UTC
Resolve in pull request: https://github.com/openSUSE/osc/pull/2157


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