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

In some cases `PromptSession.promt()` returns None

Open
#1,899 0 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

I am reporting a very elusive and hard-to-reproduce issue.

While using ipdb.set_trace() inside https://github.com/isaac-sim/IsaacLab (with docker), I discovered that the debugger hard breaks if used inside the simulation loop (e.g. simulation app is launched and running). Regular pdb does not have such issues.

After some tracing, I figured that parsing of promts by Ipython/terminal/debugger.py somehow returns None here. This line essentially relies on PromptSession.promt() of python-prompt-toolkit, here.

After downgrading to prompt-toolkit==3.0.36 the issue went away.

So,

this combination of ipython with promt_toolkit does not work

ipython==8.26.0
prompt_toolkit==3.0.47

but this one does

ipython==8.26.0
prompt-toolkit==3.0.36

I am fully aware that this an awful bug report, as it is not reproducible without running some 3rd party tools in a docker. But at least it's some documentation of the issue.

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

Start by comparing prompt-toolkit 3.0.36 and 3.0.47 with IPython 8.26.0, focusing on PromptSession.prompt() in src/prompt_toolkit/shortcuts/prompt.py and the caller in IPython/terminal/debugger.py. Reproduce the None result in the IsaacLab Docker simulation-loop context if possible, then identify the version-related behavior and verify the fix against that scenario.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.