Bug 2327969 - python-tornado fails to build with Python 3.14: RuntimeError: There is no current event loop in thread 'MainThread'.
Summary: python-tornado fails to build with Python 3.14: RuntimeError: There is no cur...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-tornado
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Python Packagers SIG
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2024-11-22 09:43 UTC by Karolina Surma
Modified: 2025-03-31 08:38 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github python cpython issues 130322 0 None open asyncio: Re-reverse deprecation of set_event_loop? 2025-03-31 08:38:00 UTC
Github tornadoweb tornado issues 3458 0 None open Errors caused by asyncio deprecation warning in full test workflow when using python 3.14.0-alpha.1 2025-02-17 05:01:45 UTC

Description Karolina Surma 2024-11-22 09:43:51 UTC
python-tornado fails to build with Python 3.14.0a1.

+ /usr/bin/python3 -m tornado.test
...............................................................sssssssssssssssssssssssssssssssssssssssssss................................s.........................................................................s.........................................................................ss...............................................................................................ss........................Traceback (most recent call last):
  File "<string>", line 1, in <module>
    from tornado.ioloop import IOLoop; classname = lambda x: x.__class__.__name__; from tornado.platform.asyncio import AsyncIOMainLoop; AsyncIOMainLoop().install(); print(classname(IOLoop.current()))
                                                                                                                                         ~~~~~~~~~~~~~~~^^
  File "/builddir/build/BUILD/python-tornado-6.4.1-build/tornado-6.4.1/tornado/util.py", line 276, in __new__
    instance.initialize(*args, **init_kwargs)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/python-tornado-6.4.1-build/tornado-6.4.1/tornado/platform/asyncio.py", line 288, in initialize
    super().initialize(asyncio.get_event_loop(), **kwargs)
                       ~~~~~~~~~~~~~~~~~~~~~~^^
  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'.
E.......................................................................................................................................................................................................................s....s...s..................................................................................................................................s....................s................s.........s.................s..............................sss.................................................s...........s................ss..........s...................................................................s..........................................................................................................................................s...................................................
======================================================================
ERROR: test_asyncio_main (tornado.test.ioloop_test.TestIOLoopConfiguration.test_asyncio_main)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-tornado-6.4.1-build/tornado-6.4.1/tornado/test/ioloop_test.py", line 789, in test_asyncio_main
    cls = self.run_python(
        "from tornado.platform.asyncio import AsyncIOMainLoop",
        "AsyncIOMainLoop().install()",
        "print(classname(IOLoop.current()))",
    )
  File "/builddir/build/BUILD/python-tornado-6.4.1-build/tornado-6.4.1/tornado/test/ioloop_test.py", line 772, in run_python
    return native_str(subprocess.check_output(args)).strip()
                      ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib64/python3.14/subprocess.py", line 472, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
               **kwargs).stdout
               ^^^^^^^^^
  File "/usr/lib64/python3.14/subprocess.py", line 577, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-c', 'from tornado.ioloop import IOLoop; classname = lambda x: x.__class__.__name__; from tornado.platform.asyncio import AsyncIOMainLoop; AsyncIOMainLoop().install(); print(classname(IOLoop.current()))']' returned non-zero exit status 1.

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/08293008-python-tornado/

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

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 Orion Poplawski 2025-02-17 05:01:45 UTC
WIth 6.4.2 the error is about deprecation warnings.  See upstream https://github.com/tornadoweb/tornado/issues/3458.  It's not immediately obvious how to ignore deprecation warning in tornado's tests, but that seems to be the way that upstream is heading.

Comment 2 Aoife Moloney 2025-02-26 13:17:23 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.


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