New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coroutine is awaited despite an exception in run_until_complete() #83372
Comments
Hi, I found that if to call run_until_complete() in the task while the event loop will be running, a coroutine sent to run_until_complete() will be performed despite the exception raised from run_until_complete(). |
Agree, this is a bug. |
This commit seems to generate some warnings in the nested run_until_complete test. The check for running loop is now done at run_until_complete itself before going through the below code in it to create a future and raised a RuntimeError by run_forever as the test used to do. Not sure why CI doesn't have these warnings. PYTHONWARNINGS=always ./python.exe -m test test_asyncio -m test_run_until_complete_nesting
0:00:00 load avg: 2.16 Run tests sequentially
0:00:00 load avg: 2.16 [1/1] test_asyncio
/Users/kasingar/stuff/python/cpython/Lib/traceback.py:220: RuntimeWarning: coroutine 'EventLoopTestsMixin.test_run_until_complete_nesting.<locals>.coro1' was never awaited
tb.tb_frame.clear()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/Users/kasingar/stuff/python/cpython/Lib/traceback.py:220: RuntimeWarning: coroutine 'EventLoopTestsMixin.test_run_until_complete_nesting.<locals>.coro1' was never awaited
tb.tb_frame.clear()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/Users/kasingar/stuff/python/cpython/Lib/traceback.py:220: RuntimeWarning: coroutine 'EventLoopTestsMixin.test_run_until_complete_nesting.<locals>.coro1' was never awaited
tb.tb_frame.clear()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback == Tests result: SUCCESS == 1 test OK. Total duration: 164 ms |
Ooh, you are right. |
Thanks for the report! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: