python comm crashes XPython kernel
Here is how to reproduce it:
- Setup the environment
pixi init
pixi add xeus-python jupyterlab
pixi run jupyter lab
- Then create a jupyter notebook using kernel
XPython - Run a single cell with content:
from comm import Comm
comm = Comm(target_name="test2")
The result is a kernel crash. I'm on linux.
I recall this was fixed in upstream xeus as part of the comms refactor. But these changes are not used by xeus-python yet
If I'm correct, this is the byproduct of missing the comm target registering. As in, before you can create a comm with this target, you need register the target.
import comm
def handle_comm_opened(*args, **kwargs):
# TODO handle comm open from front-end
pass
comm_manager = comm.get_comm_manager()
if comm_manager is not None:
comm_manager.register_target("test2", handle_comm_opened)
You mean it is fixed in this PR ?
That's what I recall from past discussion we had, though I may be wrong.
The problem is when we try to create a comm with a non-registered target, it crashes instead of failing with a nice error message.
I've just tested, it fixes the problem.