Closed DRMacIver closed 5 months ago
I've narrowed this down to a change in prompt-toolkit between version 3.0.36 and 3.0.37. If you downgrade your prompt-toolkit to 3.0.36, that will likely be sufficient to work around this issue for now.
trio-asyncio is doing some evil things here that it shouldn't be doing; it's not prompt-toolkit's fault (or IPython's). I'll see if I can fix it, but I don't totally understand how the existing code works.
Also, if you immediately reset the event loop policy (in the same cell), that seems to be a sufficient workaround also:
In [1]: import trio_asyncio, asyncio; asyncio.set_event_loop_policy(asyncio.DefaultEventLoopPolicy())
In [2]:
When running IPython 8.20.0 and trio-asyncio 0.13.0, importing trio_asyncio immediately crashes IPython:
This also happens if I import trio_asyncio indirectly (e.g. inside a function).
I cannot reproduce this crash outside of IPython - importing trio-asyncio doesn't crash in the same way, even if I do it for the first time inside a running asyncio event loop.
I was on the fence as to whether to file this with IPython or trio-asyncio - it's IPython exhibiting the problem, but I suspect it's due to shenanigans that importing trio-asyncio is doing to the running asyncio event loop. If you'd rather I file this with IPython, please let me know and I'll do so.