Bug 2367457 - python-textual fails to build with Python 3.14: RuntimeError: There is no current event loop in thread 'MainThread'.
Summary: python-textual fails to build with Python 3.14: RuntimeError: There is no cur...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: python-textual
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jonathan Wright
QA Contact:
URL:
Whiteboard:
: 2372161 (view as bug list)
Depends On:
Blocks: PYTHON3.14 F43FTBFS F43FailsToInstall 2371977
TreeView+ depends on / blocked
 
Reported: 2025-05-20 11:39 UTC by Karolina Surma
Modified: 2025-07-20 11:38 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-07-20 11:37:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2025-05-20 11:39:32 UTC
python-textual fails to build with Python 3.14.0b1.

_________ test_focus_next_and_previous_with_type_selector_without_self _________

self = App(title='App', classes={'-dark-mode'}, pseudo_classes={'focus', 'dark'})
screen = Screen(), callback = None, wait_for_dismiss = False

    def push_screen(
        self,
        screen: Screen[ScreenResultType] | str,
        callback: ScreenResultCallbackType[ScreenResultType] | None = None,
        wait_for_dismiss: bool = False,
    ) -> AwaitMount | asyncio.Future[ScreenResultType]:
        """Push a new [screen](/guide/screens) on the screen stack, making it the current screen.
    
        Args:
            screen: A Screen instance or the name of an installed screen.
            callback: An optional callback function that will be called if the screen is [dismissed][textual.screen.Screen.dismiss] with a result.
            wait_for_dismiss: If `True`, awaiting this method will return the dismiss value from the screen. When set to `False`, awaiting
                this method will wait for the screen to be mounted. Note that `wait_for_dismiss` should only be set to `True` when running in a worker.
    
        Raises:
            NoActiveWorker: If using `wait_for_dismiss` outside of a worker.
    
        Returns:
            An optional awaitable that awaits the mounting of the screen and its children, or an asyncio Future
                to await the result of the screen.
        """
        if not isinstance(screen, (Screen, str)):
            raise TypeError(
                f"push_screen requires a Screen instance or str; not {screen!r}"
            )
    
        try:
>           loop = asyncio.get_running_loop()
E           RuntimeError: no running event loop

../BUILDROOT/usr/lib/python3.14/site-packages/textual/app.py:2639: RuntimeError

During handling of the above exception, another exception occurred:

    def test_focus_next_and_previous_with_type_selector_without_self():
        """Test moving the focus with a selector that does not match the currently focused node."""
        app = App()
        with app._context():
>           app.push_screen(Screen())

tests/test_focus.py:194: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILDROOT/usr/lib/python3.14/site-packages/textual/app.py:2642: in push_screen
    future: asyncio.Future[ScreenResultType] = asyncio.Future()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

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

    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:718: RuntimeError
________________ test_softbreak_split_links_rendered_correctly _________________

    async def test_softbreak_split_links_rendered_correctly() -> None:
        """Test for https://github.com/Textualize/textual/issues/2805"""
    
        document = """\
    My site [has
    this
    URL](https://example.com)\
    """
        async with MarkdownApp(document).run_test() as pilot:
            markdown = pilot.app.query_one(Markdown)
            paragraph = markdown.children[0]
            assert isinstance(paragraph, MD.MarkdownParagraph)
            assert paragraph._text.plain == "My site has this URL"
            expected_spans = [
                Span(8, 11, Style(meta={"@click": "link('https://example.com')"})),
                Span(11, 12, Style(meta={"@click": "link('https://example.com')"})),
                Span(12, 16, Style(meta={"@click": "link('https://example.com')"})),
                Span(16, 17, Style(meta={"@click": "link('https://example.com')"})),
                Span(17, 20, Style(meta={"@click": "link('https://example.com')"})),
            ]
    
>       assert paragraph._text.spans == expected_spans
E       assert [Span(8, 11, ...ple.com')"}))] == [Span(8, 11, ...ple.com')"}))]
E         
E         At index 0 diff: Span(8, 11, Style(meta={'@click': "link('https://example.com')"})) != Span(8, 11, Style(meta={'@click': "link('https://example.com')"}))
E         Use -v to get more diff

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.)


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-b1/fedora-rawhide-x86_64/09065656-python-textual/

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

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-b1/

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 Karolina Surma 2025-06-11 16:05:10 UTC
*** Bug 2372161 has been marked as a duplicate of this bug. ***

Comment 2 Fedora Fails To Install 2025-06-20 19:53:22 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

This package fails to install and maintainers are advised to take one of the following actions:

 - Fix this bug and close this bugzilla once the update makes it to the repository.
   (The same script that posted this comment will eventually close this bugzilla
   when the fixed package reaches the repository, so you don't have to worry about it.)

or

 - Move this bug to ASSIGNED if you plan on fixing this, but simply haven't done so yet.

or

 - Orphan the package if you no longer plan to maintain it.


If you do not take one of these actions, the process at https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs will continue.
This package may be orphaned in 7+ weeks.
This is the first reminder (step 3) from the policy.

Don't hesitate to ask for help on https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ if you are unsure how to fix this bug.

Comment 3 Fedora Fails To Install 2025-07-15 08:37:06 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

This package fails to install and maintainers are advised to take one of the following actions:

 - Fix this bug and close this bugzilla once the update makes it to the repository.
   (The same script that posted this comment will eventually close this bugzilla
   when the fixed package reaches the repository, so you don't have to worry about it.)

or

 - Move this bug to ASSIGNED if you plan on fixing this, but simply haven't done so yet.

or

 - Orphan the package if you no longer plan to maintain it.


If you do not take one of these actions, the process at https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs will continue.
This package may be orphaned in 4+ weeks.
This is the second reminder (step 4) from the policy.

Don't hesitate to ask for help on https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ if you are unsure how to fix this bug.

Comment 4 Fedora Fails To Install 2025-07-20 11:37:30 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

All subpackages of a package against which this bug was filled are now installable or removed from Fedora 43.

Thanks for taking care of it!


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