Bug 2327991 - python-irc fails to build with Python 3.14: RuntimeError: There is no current event loop in thread 'MainThread'.
Summary: python-irc fails to build with Python 3.14: RuntimeError: There is no current...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-irc
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 10:18 UTC by Karolina Surma
Modified: 2025-06-10 10:54 UTC (History)
3 users (show)

Fixed In Version: python-irc-20.5.0-6.fc43
Clone Of:
Environment:
Last Closed: 2025-06-10 10:54:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github jaraco irc issues 197 0 None open In tests DeprecationWarning no event loop 2024-11-23 09:57:39 UTC
Github jaraco irc pull 236 0 None open Fix "There is no current event loop" in the asyncio test 2024-11-23 09:57:39 UTC

Description Karolina Surma 2024-11-22 10:18:55 UTC
python-irc fails to build with Python 3.14.0a2.

=================================== FAILURES ===================================
____________________________ test_privmsg_sends_msg ____________________________

    def test_privmsg_sends_msg():
        # create dummy transport, protocol
        mock_transport = MagicMock()
        mock_protocol = MagicMock()
    
        # connect to dummy server
        with suppress_issue_197():
>           loop = asyncio.get_event_loop()

irc/tests/test_client_aio.py:30: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

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

    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 ============================
FAILED irc/tests/test_client_aio.py::test_privmsg_sends_msg - RuntimeError: T...
========================= 1 failed, 35 passed in 0.91s =========================

According to https://docs.python.org/dev/whatsnew/3.14.html#id3

Removed implicit creation of event loop by asyncio.get_event_loop(). It now raises a RuntimeError if there is no current event loop. (Contributed by Kumar Aditya in gh-126353.)

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

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

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:41 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.

Comment 2 Ondrej Mosnáček 2025-06-10 10:54:36 UTC
This is now fixed (by backporting from the linked PR) in the f43-python side tag.


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