Bug 2460533 - alot fails to build with Python 3.15: TypeError: 'Mock' object cannot be interpreted as an integer
Summary: alot fails to build with Python 3.15: TypeError: 'Mock' object cannot be inte...
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: alot
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dick Marinus
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.15
TreeView+ depends on / blocked
 
Reported: 2026-04-22 08:38 UTC by Karolina Surma
Modified: 2026-05-10 11:57 UTC (History)
4 users (show)

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


Attachments (Terms of Use)

Description Karolina Surma 2026-04-22 08:38:15 UTC
alot fails to build with Python 3.15.0a8.

ERROR: test_validates (tests.utils.test_argparse.TestValidatedStore.test_validates)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/alot-0.12-build/alot-0.12/alot/utils/argparse.py", line 140, in __call__
    self.validator(values)
    ~~~~~~~~~~~~~~^^^^^^^^
  File "/builddir/build/BUILD/alot-0.12-build/alot-0.12/tests/utils/test_argparse.py", line 46, in validator
    raise cargparse.ValidationFailed
alot.utils.argparse.ValidationFailed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.15/argparse.py", line 2124, in _parse_known_args2
    namespace, args = self._parse_known_args(args, namespace, intermixed)
                      ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.15/argparse.py", line 2379, in _parse_known_args
    stop_index = consume_positionals(start_index)
  File "/usr/lib64/python3.15/argparse.py", line 2331, in consume_positionals
    take_action(action, args)
    ~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/lib64/python3.15/argparse.py", line 2200, in take_action
    action(self, namespace, argument_values, option_string)
    ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/alot-0.12-build/alot-0.12/alot/utils/argparse.py", line 142, in __call__
    raise argparse.ArgumentError(self, str(e))
argparse.ArgumentError: argument foo: 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/alot-0.12-build/alot-0.12/tests/utils/test_argparse.py", line 60, in test_validates
    self._argparse(['fail'])
    ~~~~~~~~~~~~~~^^^^^^^^^^
  File "/builddir/build/BUILD/alot-0.12-build/alot-0.12/tests/utils/test_argparse.py", line 54, in _argparse
    return parser.parse_args(args)
           ~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib64/python3.15/argparse.py", line 2085, in parse_args
    args, argv = self.parse_known_args(args, namespace)
                 ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.15/argparse.py", line 2095, in parse_known_args
    return self._parse_known_args2(args, namespace, intermixed=False)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.15/argparse.py", line 2126, in _parse_known_args2
    self.error(str(err))
    ~~~~~~~~~~^^^^^^^^^^
  File "/usr/lib64/python3.15/argparse.py", line 2884, in error
    self.print_usage(_sys.stderr)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/lib64/python3.15/argparse.py", line 2829, in print_usage
    formatter = self._get_formatter(file=file)
  File "/usr/lib64/python3.15/argparse.py", line 2812, in _get_formatter
    formatter._set_color(self.color, file=file)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.15/argparse.py", line 201, in _set_color
    if color and can_colorize(file=file):
                 ~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/lib64/python3.15/_colorize.py", line 486, in can_colorize
    return os.isatty(file.fileno())
           ~~~~~~~~~^^^^^^^^^^^^^^^
TypeError: 'Mock' object cannot be interpreted as an integer

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/10339174-alot/

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

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 Dick Marinus 2026-05-10 11:57:19 UTC
Python 3.15 does some formatting on sys.stderr for argparse and this doesn't work with a Mock object (it tries call fileno and expects an integer).

I've created a PR upstream to fix this:

https://github.com/pazz/alot/pull/1717


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