GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Odd behavior from pasting large text in the new REPL · Issue #119517 · python/cpython

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

New issue
Copy link
New issue
Copy link
Closed
Closed
Odd behavior from pasting large text in the new REPL#119517
Copy link
Labels
topic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@treyhunner
treyhunner
opened on May 24, 2024
Issue body actions

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

  • gh-119517: Fix several issues when pasting lot of text in the REPL #120234
  • gh-119517: Fixes for pasting in pyrepl #120251
  • gh-119517: Fixes for pasting in pyrepl #120253
  • [3.13] gh-119517: Fixes for pasting in pyrepl (GH-120253) #120353

Activity

  1. treyhunner
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on May 24, 2024
  2. AlexWaygood
    added
    topic-replRelated to the interactive shellRelated to the interactive shell
    on May 24, 2024
  3. pablogsal commented on Jun 4, 2024

    @pablogsal
    pablogsal
    on Jun 4, 2024
    Member
    More actions

    @treyhunner can you check if the first problem reproduces with the current main?

    Ah, yeah it reproduces. Unfortunately to fix this we would need some considerable changes to how characters are processed so I am unsure if this will get fixed before 3.13 is out.

    The problem is that to speed up pasting we are only refreshing at the end, but that doesn't input the characters in the terminal so terminal scrolling doesn't show them becase they were never written :(

    CC @ambv @lysnikolaou

  4. pablogsal commented on Jun 4, 2024

    @pablogsal
    pablogsal
    on Jun 4, 2024
    Member
    More actions

    To fix this we need to get rid of the calc_complete_screen function and replace it for something more efficient

  5. godlygeek commented on Jun 6, 2024

    @godlygeek
    godlygeek
    on Jun 6, 2024
    Contributor
    More actions

    When pasting the full 7,652 line (441,033 character) text of Frankenstein takes about 21 seconds.

    How long does it take if you export PYTHON_BASIC_REPL=1?

  6. pablogsal
    added 2 commits that reference this issue on Jun 7, 2024

    pythongh-119517: Fix several issues when pasting lot of text in the REPL

    a38b239

    gh-119517: Fixes for pasting in pyrepl (#120253)

    32a0fab
  7. miss-islington
    added a commit that references this issue on Jun 11, 2024

    pythongh-119517: Fixes for pasting in pyrepl (pythonGH-120253)

    cfedcd1
  8. pablogsal
    closed this as completedon Jun 11, 2024
  9. pablogsal
    added a commit that references this issue on Jun 11, 2024

    [3.13] gh-119517: Fixes for pasting in pyrepl (GH-120253) (#120353)

    4936575
  10. mrahtz
    added a commit that references this issue on Jun 30, 2024

    pythongh-119517: Fixes for pasting in pyrepl (python#120253)

    7484276
  11. estyxx
    added a commit that references this issue on Jul 17, 2024

    pythongh-119517: Fixes for pasting in pyrepl (python#120253)

    124b5b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.