jupyter / jupyter_client

Jupyter protocol client APIs
https://jupyter-client.readthedocs.io
BSD 3-Clause "New" or "Revised" License
383 stars 283 forks source link

`_stdin_hook_default` incorrectly uses `msg_ready` #813

Closed BrenBarn closed 2 years ago

BrenBarn commented 2 years ago

See this line. msg_ready is now async, so its return value can't be treated as a boolean anymore. I suppose it needs to be wrapped in run_sync.

davidbrochart commented 2 years ago

Thanks for reporting @BrenBarn. Indeed, this cannot work. Rather than wrapping in run_sync, we could make _stdin_hook_default an async function, and support both async and sync stdin_hook. What do you think?

BrenBarn commented 2 years ago

Having support for either sync or async stdin_hook would be great. I don't have much of an opinion on whether _stdin_hook_default should be sync or async, although I suppose making it async makes sense as it is called by an async function and calls async functions itself.