cpython icon indicating copy to clipboard operation
cpython copied to clipboard

KeyboardInterrupt during paste breaks the new REPL

Open treyhunner opened this issue 1 year ago • 2 comments

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 32a0faba439b239d7b0c242c1e3cd2025c52b8cf 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

treyhunner avatar Jul 02 '24 20:07 treyhunner

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

pygeek avatar Jul 03 '24 06:07 pygeek

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.

treyhunner avatar Jul 03 '24 22:07 treyhunner

I am working on this :)

mgmacias95 avatar Jul 13 '24 10:07 mgmacias95

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

ambv avatar Jul 16 '24 09:07 ambv