Skip to content

KeyboardInterrupt during paste breaks the new REPL #121295

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

Closed
treyhunner opened this issue Jul 2, 2024 · 4 comments
Closed

KeyboardInterrupt during paste breaks the new REPL #121295

treyhunner opened this issue Jul 2, 2024 · 4 comments
Labels
topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error

Comments

@treyhunner
Copy link
Member

treyhunner commented Jul 2, 2024

Bug report

Bug description:

To reproduce, type f = """ then paste a giant block of text (I pasted the text of Frankenstein) then press Ctrl+C immediately (while the text is being pasted).

>>> f = """
<GIANT BLOCK OF TEXT>

Then hit Ctrl+C

After this the REPL will enter a state where it seems unable to end a block of code. The prompt changes to ... and only Ctrl+C will quit out of the block.

Also nothing is displayed while typing until Enter is pressed.

Here's an animation showing the issue:

666571

This issue is also reproducible on the main branch.

I checked out commit 32a0fab and I could not reproduce this, so the issue arose sometime after #120253 was merged.

CPython versions tested on:

3.13, CPython main branch

Operating systems tested on:

Linux

Linked PRs

@treyhunner treyhunner added the type-bug An unexpected behavior, bug, or error label Jul 2, 2024
@pygeek
Copy link
Contributor

pygeek commented Jul 3, 2024

Which linux distro and version are you using? I was unable to reproduce on macOS 14.5 so the issue may be Linux specific.

@treyhunner
Copy link
Member Author

Which linux distro and version are you using? I was unable to reproduce on macOS 14.5 so the issue may be Linux specific.

I am running on Ubuntu Linux 22.04.4. I was able to reproduce the problem in both Gnome Terminal and in XTerm on my machine.

@mgmacias95
Copy link
Contributor

I am working on this :)

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 15, 2024
…ythonGH-121815)

(cherry picked from commit 498a94c)

Co-authored-by: Marta Gómez Macías <mgmacias@google.com>
@ambv ambv added the topic-repl Related to the interactive shell label Jul 15, 2024
ambv pushed a commit that referenced this issue Jul 16, 2024
…GH-121815) (GH-121826)

(cherry picked from commit 498a94c)

Co-authored-by: Marta Gómez Macías <mgmacias@google.com>
@ambv
Copy link
Contributor

ambv commented Jul 16, 2024

Thanks for the fix, Marta! ⚡️⚡️⚡️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

5 participants
@ambv @pygeek @treyhunner @mgmacias95 and others