Skip to content

Fix Python 3.14 asyncio event loop compatibility#155

Open
BinaryHusk wants to merge 1 commit intopedroCabrera:masterfrom
BinaryHusk:master
Open

Fix Python 3.14 asyncio event loop compatibility#155
BinaryHusk wants to merge 1 commit intopedroCabrera:masterfrom
BinaryHusk:master

Conversation

@BinaryHusk
Copy link
Copy Markdown

Summary

Fix Python 3.14 support in the standalone editor after asyncio.get_event_loop() changed behavior in Python 3.14.

This updates the editor tick path and subProcess node task creation, and adds a regression test for both cases.

Problem

According to the Python 3.14 event loop documentation, asyncio.get_event_loop() now raises RuntimeError if there is no current event loop.

PyFlow still relied on the old behavior in:

  • PyFlow/App.py
  • PyFlow/Packages/PyFlowBase/Nodes/subProcess.py

That caused standalone startup to fail with:

RuntimeError: There is no current event loop in thread 'MainThread'

image

Fix

  • Add a small shared event loop helper in PyFlow/Core/AsyncLoop.py
  • Create and reuse that loop when PyFlow is running without a current default event loop
  • Use the shared loop in PyFlow/App.py so the standalone editor tick no longer depends on asyncio.get_event_loop()
  • Use the same shared loop in PyFlow/Packages/PyFlowBase/Nodes/subProcess.py when creating async tasks
  • Clean up the shared loop on app shutdown
  • Add regression coverage for both failure points so the editor tick path and subProcess path are both checked

Compatibility

Verified on Python 3.9 through 3.14.

Existing tests pass, and the standalone editor no longer hits the repeated event loop error on Python 3.14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant