Open
Description
I am testing with python 3.12.3 and PySide6 6.7.0. When using qasync >= 0.24.2, the attached script fails on the call to asyncio.create_task
with this exception:
Traceback (most recent call last):
File "/Users/jdp/python/./qtest.py", line 38, in <module>
aw = MyAppWindow()
^^^^^^^^^^^^^
File "/Users/jdp/python/./qtest.py", line 22, in __init__
self.task = asyncio.create_task(self.my_task())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/tasks.py", line 417, in create_task
loop = events.get_running_loop()
^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: no running event loop
sys:1: RuntimeWarning: coroutine 'MyAppWindow.my_task' was never awaited
The failure does not occur with qasync 0.24.0. Uncommenting the statement
#asyncio.events._set_running_loop(loop)
works around the problem, but it is undesirable because it uses a private API.
qtest.py.txt
Metadata
Metadata
Assignees
Labels
No labels