ipython / ipython/ipykernel

close_loop coroutine instantiated but never awaited in (old?) asyncio loop integration

未關閉
#1,260 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
734
分支
412
平均合併
1 天 5 小時
30 天內合併 PR
8

描述

I was trawling through the source code and I spotted what looks to me like a possible bug here:
https://github.com/ipython/ipykernel/blob/d4a8703593cbe5d82bc955d68543dc623f5b4510/ipykernel/eventloops.py#L455

This instantiates a coroutine that never gets awaited. Calling an async def function just returns a coroutine object and does not start evaluating the function until the coroutine is started.

Additional poking around makes it look like asyncio loop integration here is actually semi-dead code from an era when the tornado event loop and asynio event loop where not the same event loop (tornado < 5?). Seems like this should be cleaned up, as my read is this old asyncio loop integration is not being maintained. Maybe a deprecation warning should be displayed if anyone tries to use `%gui asyncio` or something?

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。