Skip to content

Odd behavior from pasting large text in the new REPL #119517

Closed
@treyhunner

Description

@treyhunner

Bug report

Bug description:

This is a description of a few bugs related to paste mode in the new REPL.

Blank lines

I tried copy-pasting the first 604 lines of this copy of Frankenstein (about 32,000 characters).

After pasting, when I scroll up in my terminal I see 1 additional line above the currently visible lines (the 61 last lines) and then I see 543 blank lines. It seems that the first 543/604 lines show up as blank and the last 61 lines do not.

>>> f = """


[539 more blank lines]


... appreciate the extraordinary merits of this wonderful man.  Sometimes I
... have endeavoured to discover what quality it is which he possesses that
[57 more lines of text]
... embraced the gallant vessel on its course and wrecked it--thus!
... """
>>>

I assume this behavior may have been for the purpose of enhancing performance.
Pasting this text only took about 1 second, which is much faster than a couple weeks ago) but still slower than the old REPL.
I have not yet attempted to reproduce the blank line issue before #119341 was merged to see if it was the cause.

Paste performance and Ctrl+C

When pasting the full 7,652 line (441,033 character) text of Frankenstein takes about 21 seconds.
That's again, considerably faster than it would have been a couple weeks ago, though it does still takes a bit of time.

The most concerning part about the slow pasting is that the terminal is entirely locked during pasting.
Hitting Ctrl+C does not stop pasting and the arrow keys don't work.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions