Bug 2327986 - python-sh fails to build with Python 3.14: RuntimeError: There is no current event loop in thread 'MainThread'.
Summary: python-sh fails to build with Python 3.14: RuntimeError: There is no current ...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-sh
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora Infrastructure SIG
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2024-11-22 10:14 UTC by Karolina Surma
Modified: 2024-12-08 21:52 UTC (History)
6 users (show)

Fixed In Version: python-sh-2.1.0-2.fc42
Clone Of:
Environment:
Last Closed: 2024-12-08 21:52:21 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github amoffat sh issues 741 0 None open FunctionalTests.test_async* tests raise RuntimeErrors with Python 3.14 2024-12-07 08:13:09 UTC

Description Karolina Surma 2024-11-22 10:14:57 UTC
python-sh fails to build with Python 3.14.0a2.

======================================================================
ERROR: test_async_iter_exc (__main__.FunctionalTests.test_async_iter_exc)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-sh-2.0.6-build/sh-2.0.6/sh_test.py", line 1787, in test_async_iter_exc
    loop = asyncio.get_event_loop()
  File "/usr/lib64/python3.14/asyncio/events.py", line 681, in get_event_loop
    raise RuntimeError('There is no current event loop in thread %r.'
                       % threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'MainThread'.

---------------------------------------------------------------------
FAILED (errors=4, skipped=1)

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/08292779-python-sh/

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

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 Carl George 🤠 2024-12-07 08:13:10 UTC
Reported upstream with a corresponding pull request.  I'd like to wait for upstream feedback on the approach I took before including it as a patch in our package.

Comment 2 Carl George 🤠 2024-12-08 21:52:21 UTC
The upstream PR was merged, and I added the fix as a patch to the package.  I forgot to use the bug number in the commit message, but it was built here for Rawhide:

https://bodhi.fedoraproject.org/updates/FEDORA-2024-e9a6904d8f

And I can see it was automatically rebuilt here in the Python 3.14 copr:

https://copr.fedorainfracloud.org/coprs/g/python/python3.14/build/8364185/


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