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: CLOSED RAWHIDE
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:
: 2485685 2486117 2486513 (view as bug list)
Depends On:
Blocks: PYTHON3.15 F45FTBFS F45FailsToInstall
TreeView+ depends on / blocked
 
Reported: 2026-04-22 08:38 UTC by Karolina Surma
Modified: 2026-06-10 07:48 UTC (History)
5 users (show)

Fixed In Version: alot-0.12-6.fc45
Clone Of:
Environment:
Last Closed: 2026-06-10 07:48:32 UTC
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

Comment 2 Karolina Surma 2026-06-06 18:19:06 UTC
*** Bug 2485685 has been marked as a duplicate of this bug. ***

Comment 3 Dick Marinus 2026-06-07 18:22:26 UTC
PR had been merged, added to rawhide spec file

Comment 4 Miro Hrončok 2026-06-07 20:03:58 UTC
There are no new commits in https://src.fedoraproject.org/rpms/alot/commits/rawhide

Comment 5 Miro Hrončok 2026-06-07 20:04:11 UTC
*** Bug 2486117 has been marked as a duplicate of this bug. ***

Comment 6 Dick Marinus 2026-06-08 17:37:43 UTC
Whups, sorry I pushed to the wrong remote, I now merged it to the right repository:
https://src.fedoraproject.org/rpms/alot/pull-request/20

Comment 7 Miro Hrončok 2026-06-08 18:52:01 UTC
Please also build it.

Comment 8 Miro Hrončok 2026-06-08 18:52:19 UTC
*** Bug 2486513 has been marked as a duplicate of this bug. ***

Comment 9 Miro Hrončok 2026-06-10 07:48:32 UTC
Thanks.


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