Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-118877: Fix AssertionError crash in pyrepl #118936

Merged
merged 2 commits into from
May 20, 2024

Conversation

danielhollas
Copy link
Contributor

@danielhollas danielhollas commented May 11, 2024

A crash of the new pyrepl was triggered by pressing up arrow when tab completion menu was displayed. Fixes #118877

While this simple fix does the trick, as @lysnikolaou mentioned in a #118877 (comment), there are other issues with how arrows interact with tab completions menu, so a more holistic fix might be needed eventually.
I am hoping this is still useful to at least stop interpreter from crashing. Also the added test can serve is as a regression test.

(it took me quite a while to figure out how to write the test, suggestions how to improve it are welcome 🙏 )

A crash of the new pyrepl was triggered by
pressing up arrow when tab completion menu was displayed.
@Eclips4 Eclips4 added the topic-repl Related to the interactive shell label May 11, 2024
@ambv ambv added the skip news label May 20, 2024
@ambv ambv merged commit c0d81b2 into python:main May 20, 2024
41 checks passed
@danielhollas danielhollas deleted the fix-pyrepl-tab-up branch May 20, 2024 19:03
@lysnikolaou lysnikolaou added the needs backport to 3.13 bugs and security fixes label May 21, 2024
@miss-islington-app
Copy link

Thanks @danielhollas for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 21, 2024
(cherry picked from commit c0d81b2)

Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
@bedevere-app
Copy link

bedevere-app bot commented May 21, 2024

GH-119363 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label May 21, 2024
lysnikolaou pushed a commit that referenced this pull request May 22, 2024
…9363)

(cherry picked from commit c0d81b2)

Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news topic-repl Related to the interactive shell
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AssertionError occurs using 3.130b1 interactive mode when pressed tab and up arrow
4 participants