Closed NeilGirdhar closed 1 year ago
I can reproduce this with python 3.10.9:
$ jupyter-console --kernel=python
Jupyter console 6.4.4
Python 3.10.9 (main, Dec 19 2022, 17:35:49) [GCC 12.2.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.9.0 -- An enhanced Interactive Python. Type '?' for help.
Unhandled exception in event loop:
File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/usr/lib/python3.10/site-packages/prompt_toolkit/input/vt100.py", line 173, in callback_wrapper
callback()
File "/usr/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 707, in read_from_input
self.key_processor.process_keys()
File "/usr/lib/python3.10/site-packages/prompt_toolkit/key_binding/key_processor.py", line 270, in process_keys
self._process_coroutine.send(key_press)
File "/usr/lib/python3.10/site-packages/prompt_toolkit/key_binding/key_processor.py", line 185, in _process
self._call_handler(matches[-1], key_sequence=buffer[:])
File "/usr/lib/python3.10/site-packages/prompt_toolkit/key_binding/key_processor.py", line 320, in _call_handler
handler.call(event)
File "/usr/lib/python3.10/site-packages/prompt_toolkit/key_binding/key_bindings.py", line 124, in call
result = self.handler(event)
File "/usr/lib/python3.10/site-packages/jupyter_console/ptshell.py", line 477, in _
self.handle_iopub()
File "/usr/lib/python3.10/site-packages/jupyter_console/ptshell.py", line 854, in handle_iopub
while run_sync(self.client.iopub_channel.msg_ready)():
File "/usr/lib/python3.10/site-packages/jupyter_core/utils/__init__.py", line 147, in run_sync
raise AssertionError
Exception
Press ENTER to continue...
Fixed by #276.
Same problem with completions:
Type from typing import
then hit tab.
Unhandled exception in event loop:
File "/home/neil/.cache/pypoetry/virtualenvs/tjax-DRMj3ydM-py3.11/lib/python3.11/site-packages/prompt_toolkit/buffer.py", line 1939, in new_coroutine
await coroutine(*a, **kw)
File "/home/neil/.cache/pypoetry/virtualenvs/tjax-DRMj3ydM-py3.11/lib/python3.11/site-packages/prompt_toolkit/eventloop/async_context_manager.py", line 79, in __aexit__
await self.gen.athrow(typ, value, traceback)
File "/home/neil/.cache/pypoetry/virtualenvs/tjax-DRMj3ydM-py3.11/lib/python3.11/site-packages/prompt_toolkit/eventloop/async_generator.py", line 42, in aclosing
yield thing
File "/home/neil/.cache/pypoetry/virtualenvs/tjax-DRMj3ydM-py3.11/lib/python3.11/site-packages/prompt_toolkit/buffer.py", line 1763, in async_completer
async for completion in async_generator:
File "/home/neil/.cache/pypoetry/virtualenvs/tjax-DRMj3ydM-py3.11/lib/python3.11/site-packages/prompt_toolkit/completion/base.py", line 326, in get_completions_async
async for completion in completer.get_completions_async(
File "/home/neil/.cache/pypoetry/virtualenvs/tjax-DRMj3ydM-py3.11/lib/python3.11/site-packages/prompt_toolkit/completion/base.py", line 202, in get_completions_async
for item in self.get_completions(document, complete_event):
File "/home/neil/.cache/pypoetry/virtualenvs/tjax-DRMj3ydM-py3.11/lib/python3.11/site-packages/jupyter_console/ptshell.py", line 174, in get_completions
content = self.jup_completer.complete_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/neil/.cache/pypoetry/virtualenvs/tjax-DRMj3ydM-py3.11/lib/python3.11/site-packages/jupyter_console/completer.py", line 37, in complete_request
msg = run_sync(self.client.shell_channel.get_msg)(timeout=self.timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/neil/.cache/pypoetry/virtualenvs/tjax-DRMj3ydM-py3.11/lib/python3.11/site-packages/jupyter_core/utils/__init__.py", line 147, in run_sync
raise AssertionError
Jupyter console appears to be simply broken since any use of it triggers an assertion:
then I type "x" and press enter, which produces:
Apparently,
self.client.iopub_channel.msg_ready
is not a coroutine, butrun_sync
expects it to be.