https://github.com/python/cpython/commit/0b4c7da5c401154af7b7cb89a6467365cadc2653
commit: 0b4c7da5c401154af7b7cb89a6467365cadc2653
branch: main
author: Shardul Deshpande <[email protected]>
committer: gpshead <[email protected]>
date: 2026-09-08T04:04:21Z
summary:
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.
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]