jupyter / jupyter_core

Core Jupyter functionality
https://jupyter-core.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
194 stars 180 forks source link

Fix event loop handling #362

Closed blink1073 closed 10 months ago

blink1073 commented 10 months ago

Fixes https://github.com/jupyter/jupyter_client/issues/959

Fixes https://github.com/spyder-ide/spyder/issues/21338

blink1073 commented 10 months ago

cc @maartenbreddels this was a nice typing cleanup. :)

blink1073 commented 10 months ago

I'll make the release tomorrow.

maartenbreddels commented 10 months ago

Nice indeed :)

samuelan commented 9 months ago

I have some codes that use run_sync(coroutine_a), and with jupyter_core==5.3.2, it stops working. The code complains File "/opt/conda/lib/python3.9/site-packages/jupyter_core/utils/init.py", line 168, in wrapped return loop.run_until_complete(inner) File "/opt/conda/lib/python3.9/asyncio/base_events.py", line 623, in run_until_complete self._check_running() File "/opt/conda/lib/python3.9/asyncio/base_events.py", line 583, in _check_running raise RuntimeError('This event loop is already running') RuntimeError: This event loop is already running

once I revert to 5.3.1 version. It started to work. Do codes that depend on jupyter_core need to change after this change, any documentation?

blink1073 commented 9 months ago

Hi @samuelan, can you please open a new issue with some code that reproduces the error?

samuelan commented 9 months ago

Hi @samuelan, can you please open a new issue with some code that reproduces the error?

Sure. It's a bit involved. I will try a repro with simplified codes, and circle back when I get it.