prompt-toolkit / python-prompt-toolkit

Library for building powerful interactive command line applications in Python
https://python-prompt-toolkit.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
9.28k stars 715 forks source link

Unhandled exception in event loop when used with asyncio #1745

Closed zhouguoqionghai closed 1 year ago

zhouguoqionghai commented 1 year ago

I do not know how to recovery this.

Unhandled exception in event loop: File "/usr/lib/python3.9/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.9/dist-packages/prompt_toolkit/input/vt100.py", line 170, in callback_wrapper callback() File "/usr/local/lib/python3.9/dist-packages/prompt_toolkit/application/application.py", line 711, in read_from_input self.key_processor.process_keys() File "/usr/local/lib/python3.9/dist-packages/prompt_toolkit/key_binding/key_processor.py", line 270, in process_keys self._process_coroutine.send(key_press) File "/usr/local/lib/python3.9/dist-packages/prompt_toolkit/key_binding/key_processor.py", line 185, in _process self._call_handler(matches[-1], key_sequence=buffer[:]) File "/usr/local/lib/python3.9/dist-packages/prompt_toolkit/key_binding/key_processor.py", line 320, in _call_handler handler.call(event) File "/usr/local/lib/python3.9/dist-packages/prompt_toolkit/key_binding/key_bindings.py", line 124, in call result = self.handler(event) File "/usr/local/lib/python3.9/dist-packages/prompt_toolkit/keybinding/bindings/cpr.py", line 26, in event.app.renderer.report_absolute_cursor_row(row) File "/usr/local/lib/python3.9/dist-packages/prompt_toolkit/renderer.py", line 545, in report_absolute_cursor_row f.set_result(None)

zhouguoqionghai commented 1 year ago

Maybe just not use right.I took some time to learn asyncio and changed my code, the exception never happen again. By the way, thanks for your work.