]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-143082: Make readline work when sys.stdin is explicitly passed to pdb (#143083)
authorDenizhan Dakılır <denizhandakilirn@gmail.com>
Mon, 5 Jan 2026 04:39:11 +0000 (07:39 +0300)
committerGitHub <noreply@github.com>
Mon, 5 Jan 2026 04:39:11 +0000 (20:39 -0800)
Lib/pdb.py
Misc/NEWS.d/next/Windows/2025-12-25-00-38-20.gh-issue-143082.CYUeux.rst [new file with mode: 0644]

index eee0273fdc463f975d431256d38903f25e35ef93..0464b288ef825ab72a487d2addb58a2a3a228a7b 100644 (file)
@@ -364,7 +364,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
         bdb.Bdb.__init__(self, skip=skip, backend=backend if backend else get_default_backend())
         cmd.Cmd.__init__(self, completekey, stdin, stdout)
         sys.audit("pdb.Pdb")
-        if stdin:
+        if stdin is not None and stdin is not sys.stdin:
             self.use_rawinput = False
         self.prompt = '(Pdb) '
         self.aliases = {}
diff --git a/Misc/NEWS.d/next/Windows/2025-12-25-00-38-20.gh-issue-143082.CYUeux.rst b/Misc/NEWS.d/next/Windows/2025-12-25-00-38-20.gh-issue-143082.CYUeux.rst
new file mode 100644 (file)
index 0000000..0652c4c
--- /dev/null
@@ -0,0 +1 @@
+Fix :mod:`pdb` arrow key history not working when ``stdin`` is ``sys.stdin``.