Test case 'test_privmsg_sends_msg' failure: RuntimeError: There is no current event loop in thread 'MainThread'.
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- testing-qa
Research direction
The failing call is asyncio.get_event_loop() at irc/tests/test_client_aio.py line 30 inside test_privmsg_sends_msg, which runs under the suppress_issue_197() context manager. Start by reading that test and the helper, then run python3 -m pytest irc/tests/test_client_aio.py::test_privmsg_sends_msg on Python 3.14 to reproduce. Done means the test passes on 3.14 without deprecated loop access, and the rest of the suite still passes.
Written by the indexing model from the issue text.
Description
When running the test suite on a minimal install of the package (source release “20.5.0”), the test case 'test_privmsg_sends_msg' fails:
$ python3 --version
Python 3.14.8
$ python3 -m pytest
============================= test session starts ==============================
platform linux -- Python 3.14.8, pytest-9.1.1, pluggy-1.6.0
rootdir: /build/reproducible-path/python-irc-20.5.0+dfsg1/.pybuild/cpython3_3.14_irc/build
configfile: pytest.ini
plugins: typeguard-4.4.4
collected 36 items / 2 deselected / 34 selected
[…]
=================================== 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 0x7f27a9570ad0>
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/lib/python3.14/asyncio/events.py:718: RuntimeError
[…]
- Dominant language
- Python
- Stars
- 422
- Forks
- 91
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jaraco/irc
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
CTCP ISSUEOpen
Difficulty 1/5 Under an hour Newbie friendliness 55/100
Similar issues
-
area:cli area:security bug priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
docs pydanty:is-working
Difficulty 1/5 Under an hour Newbie friendliness 88/100
pydantic/pydantic-ai#13563 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
NCATSTranslator/Babel#1204 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
alltheplaces/alltheplaces#20570 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
sio2project/oioioi#981 · 1 reaction ·
Maintainers usually reply within 1 day