-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
The new REPL fails on Ctrl-C after search #123856
Comments
Which version of the interpreter does this problem occur in? |
What do I need to type into the interpreter to trigger this error?
|
It is present in 3.13rc2. You can reproduce by just typing "ctrl+r", "enter", "ctrl+c". |
Okay, I have testing |
I typed ctrl+r, enter, ctrl+c in sequence. The following output appeared:
|
GitHub eats text in angle brackets if it is not quoted. I reproduced with a cursor moving key like Reproduced in the current 3.12 and main branches. |
You meant 3.13, right? I confirm. |
With diff --git a/Lib/_pyrepl/reader.py b/Lib/_pyrepl/reader.py
index 54bd1ea022..f525e82442 100644
--- a/Lib/_pyrepl/reader.py
+++ b/Lib/_pyrepl/reader.py
@@ -556,7 +556,8 @@ def push_input_trans(self, itrans: input.KeymapTranslator) -> None:
self.input_trans = itrans
def pop_input_trans(self) -> None:
- self.input_trans = self.input_trans_stack.pop()
+ if self.input_trans_stack:
+ self.input_trans = self.input_trans_stack.pop()
def setpos_from_xy(self, x: int, y: int) -> None:
"""Set pos according to coordinates x, y""" I've "KeyboardInterrupt" printed instead and a new If this does make sense, I'll make pr. |
I do not know whether this is the right fix or just sweeping the issue under a cover. |
CC @ambv |
I'm on it. |
…-up command; add tests
…gered after using a history search
…-up command; add tests
…after using a history search (#124396) Co-authored-by: Łukasz Langa <[email protected]>
…gered after using a history search (pythonGH-124396) (cherry picked from commit c1600c7) Co-authored-by: Emily Morehouse <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
…ggered after using a history search (GH-124396) (#124530) gh-123856: Fix PyREPL failure when a keyboard interrupt is triggered after using a history search (GH-124396) (cherry picked from commit c1600c7) Co-authored-by: Emily Morehouse <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
Fixed and will be included in 3.13.0! |
How to reproduce:
<Ctrl-R>
. You should see the "(r-search `')
" prompt.<Right>
. You should see the normal REPL prompt ">>>
".<Ctrl-C>
. The REPL quits with a traceback.Linked PRs
The text was updated successfully, but these errors were encountered: