FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.15] gh-154467: Fix empty (Pdb) prompt when attaching to a process with pdb -p (GH-154469) by miss-islington · Pull Request #156397 · python/cpython · GitHub

/ cpython Public

[3.15] gh-154467: Fix empty (Pdb) prompt when attaching to a process with pdb -p (GH-154469) - #156397

Open
miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-1ec5607-3.15
Open

[3.15] gh-154467: Fix empty (Pdb) prompt when attaching to a process with pdb -p (GH-154469)#156397
miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-1ec5607-3.15

Conversation

miss-islington commented Aug 26, 2026
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

_PdbServer inherits _cmdloop, which wraps cmdloop() in
_maybe_use_pyrepl_as_stdin(). That context manager blanks self.prompt to ''
so that a local pyrepl draws the prompt itself. The remote server, however,
never reads from a local pyrepl -- it transmits self.prompt to the client
over the socket -- so the blanking made it send an empty prompt whenever the
target process had a pyrepl-capable terminal (pyrepl_input is set).

Override _maybe_use_pyrepl_as_stdin() in _PdbServer to a no-op, keeping the
real prompt. Add an integration test that attaches to a target running under
a pty, so PyREPL is genuinely enabled inside it, and asserts the transmitted
prompt is "(Pdb) ".
(cherry picked from commit 1ec5607)

Co-authored-by: Łukasz Langa lukasz@langa.pl
Co-authored-by: Claude Opus 4.8 (1M context) noreply@anthropic.com

…ith pdb -p (pythonGH-154469)

_PdbServer inherits _cmdloop, which wraps cmdloop() in
_maybe_use_pyrepl_as_stdin(). That context manager blanks self.prompt to ''
so that a local pyrepl draws the prompt itself. The remote server, however,
never reads from a local pyrepl -- it transmits self.prompt to the client
over the socket -- so the blanking made it send an empty prompt whenever the
target process had a pyrepl-capable terminal (pyrepl_input is set).

Override _maybe_use_pyrepl_as_stdin() in _PdbServer to a no-op, keeping the
real prompt. Add an integration test that attaches to a target running under
a pty, so PyREPL is genuinely enabled inside it, and asserts the transmitted
prompt is "(Pdb) ".
(cherry picked from commit 1ec5607)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL