https://github.com/python/cpython/commit/eb382a3ceb1403afba42157eae33c73e486ca595
commit: eb382a3ceb1403afba42157eae33c73e486ca595
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: gpshead <[email protected]>
date: 2026-09-08T04:32:44Z
summary:

[3.14] gh-150922: Fix test_cmd libedit assertion in 
test_bang_completion_without_do_shell (GH-156623) (#157156)

gh-150922: Fix test_cmd libedit assertion in 
test_bang_completion_without_do_shell (GH-156623)

GNU readline retypes the full completed word after tab completion, but
libedit redraws only the untyped suffix following a cursor-forward
escape sequence. Assert on the common suffix ('ello') instead of the
literal 'hello' bytes so the test passes on both backends.
(cherry picked from commit 0b4c7da5c401154af7b7cb89a6467365cadc2653)

Co-authored-by: Shardul Deshpande <[email protected]>

files:
M Lib/test/test_cmd.py

diff --git a/Lib/test/test_cmd.py b/Lib/test/test_cmd.py
index dbfec42fc21988..ed3336994edaeb 100644
--- a/Lib/test/test_cmd.py
+++ b/Lib/test/test_cmd.py
@@ -316,7 +316,10 @@ def default(self, line):
         for input in [b"! h\t\n", b"!h\t\n"]:
             with self.subTest(input=input):
                 output = run_pty(script, input)
-                self.assertIn(b'hello', output)
+                # libedit redraws only the untyped suffix after a
+                # cursor-forward escape, unlike GNU readline which retypes
+                # the whole completed word, so check the common suffix.
+                self.assertIn(b'ello', output)
                 self.assertIn(b'tab completion success', output)
 
 def load_tests(loader, tests, pattern):

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to