Bug 2327972 - python-autocommand fails to build with Python 3.14: RuntimeError: There is no current event loop in thread 'MainThread'.
Summary: python-autocommand fails to build with Python 3.14: RuntimeError: There is no...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-autocommand
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ondrej Mosnáček
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2024-11-22 09:55 UTC by Karolina Surma
Modified: 2025-06-15 18:31 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-06-15 18:31:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources python-autocommand pull-request 3 0 None None None 2025-05-27 20:37:41 UTC
Github Lucretiel autocommand issues 39 0 None open test_autoasync fails under Python 3.14.0a2 2024-11-23 10:10:27 UTC
Github Lucretiel autocommand pull 40 0 None open Fix tests for Python 3.14+ 2025-05-27 19:37:57 UTC

Description Karolina Surma 2024-11-22 09:55:22 UTC
python-autocommand fails to build with Python 3.14.0a2.

_____________________ ERROR at setup of test_defered_loop ______________________

    @pytest.fixture
    def context_loop():
        '''
        Create a new event loop and set it as the current context event loop.
        asyncio.get_event_loop() will return this loop within this fixture. Restore
        the original current event loop afterwards. The new loop is also closed
        afterwards.
        '''
    
        # Can't reuse new_loop() because some tests require new_loop and
        # context_loop to be different
        with closing(asyncio.new_event_loop()) as new_loop:
>           with temporary_context_loop(new_loop):

test/test_autoasync.py:64: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib64/python3.14/contextlib.py:141: in __enter__
    return next(self.gen)
test/test_autoasync.py:35: in temporary_context_loop
    old_loop = asyncio.get_event_loop()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <asyncio.unix_events._UnixDefaultEventLoopPolicy object at 0x7f5175d54590>

    def get_event_loop(self):
        """Get the event loop for the current context.
    
        Returns an instance of EventLoop or raises an exception.
        """
        if self._local._loop is None:
>           raise RuntimeError('There is no current event loop in thread %r.'
                               % threading.current_thread().name)
E           RuntimeError: There is no current event loop in thread 'MainThread'.

/usr/lib64/python3.14/asyncio/events.py:681: RuntimeError
=========================== short test summary info ============================
ERROR test/test_autoasync.py::test_basic_autoasync - RuntimeError: There is n...
ERROR test/test_autoasync.py::test_custom_loop - RuntimeError: There is no cu...
ERROR test/test_autoasync.py::test_pass_loop - RuntimeError: There is no curr...
ERROR test/test_autoasync.py::test_pass_loop_prior_argument - RuntimeError: T...
ERROR test/test_autoasync.py::test_pass_loop_kwarg_only - RuntimeError: There...
ERROR test/test_autoasync.py::test_run_forever - RuntimeError: There is no cu...
ERROR test/test_autoasync.py::test_run_forever_func - RuntimeError: There is ...
ERROR test/test_autoasync.py::test_defered_loop - RuntimeError: There is no c...
========================= 10 passed, 8 errors in 0.25s =========================

https://docs.python.org/3.14/whatsnew/3.14.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08290998-python-autocommand/

For all our attempts to build python-autocommand with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/python-autocommand/

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.14:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
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 Aoife Moloney 2025-02-26 13:17:25 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.

Comment 2 Miro Hrončok 2025-05-27 19:37:57 UTC
Fix in https://github.com/Lucretiel/autocommand/pull/40


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