GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-150922: Fix test_cmd libedit assertion in test_bang_completion_without_do_shell by iamsharduld · Pull Request #156623 · python/cpython

Conversation

@iamsharduld

@iamsharduld iamsharduld commented Aug 30, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Fixes #150922

test_bang_completion_without_do_shell asserted that the raw PTY
transcript contains the literal bytes b'hello' after tab-completing
!h<TAB>. That only holds for GNU readline, which retypes the whole
completed word. libedit instead redraws via a cursor-forward escape
sequence and only re-emits the untyped suffix (e.g. \x1b[9Cello),
so the assertion fails on libedit-linked builds (default on macOS/BSD,
and used on some Linux distros) even though completion works
correctly.

This switches the assertion to check for b'ello', the suffix common
to both backends' output, so the test no longer depends on
backend-specific echo/redraw formatting. The existing
tab completion success assertion right below it still verifies the
functional outcome of the completion.

Test-only change; no behavior change in Lib/cmd.py, so no
Misc/NEWS.d entry per the devguide's test-change exemption.

  • Issue: test_cmd fails if build with editline not readline #150922

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iamsharduld
pythongh-150922: Fix test_cmd libedit assertion in test_bang_completi…
6712528
…on_without_do_shell

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.
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Aug 30, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Aug 30, 2026
test_cmd fails if build with editline not readline #150922
Closed
@bedevere-app bedevere-app Bot added the awaiting review label Aug 30, 2026
@aisk aisk added the skip news label Aug 31, 2026
gpshead
gpshead approved these changes Sep 8, 2026
View reviewed changes

@gpshead gpshead left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Sep 8, 2026
@gpshead gpshead added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Sep 8, 2026
@gpshead
gpshead enabled auto-merge (squash) September 8, 2026 04:03
@gpshead gpshead self-assigned this Sep 8, 2026
@gpshead
gpshead merged commit 0b4c7da into python:main Sep 8, 2026
64 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Sep 8, 2026

Copy link
Copy Markdown

Thanks @iamsharduld for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Sep 8, 2026
@bedevere-app

bedevere-app Bot commented Sep 8, 2026

Copy link
Copy Markdown

GH-157155 is a backport of this pull request to the 3.15 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Sep 8, 2026
@miss-islington-app

miss-islington-app Bot commented Sep 8, 2026

Copy link
Copy Markdown

Sorry, @iamsharduld and @gpshead, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 0b4c7da5c401154af7b7cb89a6467365cadc2653 3.13
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app

bedevere-app Bot commented Sep 8, 2026

Copy link
Copy Markdown

GH-157156 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Sep 8, 2026
@gpshead gpshead removed the needs backport to 3.13 only security fixes label Sep 8, 2026
gpshead pushed a commit that referenced this pull request Sep 8, 2026
@miss-islington @iamsharduld
[3.14] gh-150922: Fix test_cmd libedit assertion in test_bang_complet…
eb382a3
…ion_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 0b4c7da)

Co-authored-by: Shardul Deshpande <[email protected]>
clin1234 pushed a commit to clin1234/cpython that referenced this pull request Sep 12, 2026
@iamsharduld @clin1234
pythongh-150922: Fix test_cmd libedit assertion in test_bang_completi…
9692e1d
…on_without_do_shell (pythonGH-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.
johnslavik pushed a commit to johnslavik/cpython that referenced this pull request Sep 14, 2026
@iamsharduld @johnslavik
pythongh-150922: Fix test_cmd libedit assertion in test_bang_completi…
46c2697
…on_without_do_shell (pythonGH-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.
serhiy-storchaka pushed a commit that referenced this pull request Oct 10, 2026
@miss-islington @iamsharduld
[3.15] gh-150922: Fix test_cmd libedit assertion in test_bang_complet…
ff3b98c
…ion_without_do_shell (GH-156623) (GH-157155)

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 0b4c7da)

Co-authored-by: Shardul Deshpande <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gpshead gpshead gpshead approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@gpshead gpshead

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

test_cmd fails if build with editline not readline

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@iamsharduld @gpshead @aisk
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.