prompt-toolkit / prompt-toolkit/python-prompt-toolkit

RuntimeError: no running event loop on version 3.0.37

Open
#1,726 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.6k
Forks
815
PR merge metrics
No merged PRs in 30d

Description

My app (jellex) is getting the following traceback when starting on prompt-toolkit version 3.0.37. Previous versions of prompt-toolkit seem to work fine.

Traceback (most recent call last):
  File "/Users/kbrazil/.pyenv/versions/3.11.1/bin/jellex", line 5, in <module>
    from jellex.cli import main
  File "/Users/kbrazil/.pyenv/versions/3.11.1/lib/python3.11/site-packages/jellex/cli.py", line 231, in <module>
    query.insert_text('_')
  File "/Users/kbrazil/.pyenv/versions/3.11.1/lib/python3.11/site-packages/prompt_toolkit/buffer.py", line 1269, in insert_text
    get_app().create_background_task(self._async_completer())
  File "/Users/kbrazil/.pyenv/versions/3.11.1/lib/python3.11/site-packages/prompt_toolkit/application/application.py", line 1057, in create_background_task
    loop = self.loop or get_running_loop()
                        ^^^^^^^^^^^^^^^^^^
RuntimeError: no running event loop
sys:1: RuntimeWarning: coroutine 'Buffer._create_completer_coroutine.<locals>.async_completer' was never awaited

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the startup failure in jellex with prompt-toolkit 3.0.37, then inspect prompt_toolkit/buffer.py and prompt_toolkit/application/application.py at the traceback locations. Compare behavior with a working prompt-toolkit version; done means the application starts without the event-loop error or unawaited-coroutine warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.