Skip to content

REPL block navigation results in errors #150615

@treyhunner

Description

@treyhunner

Bug report

Bug description:

I have hit this issue at least a few times over the past few months. I haven't figured out how to reproduce it consistently yet, but I believe block navigation with Ctrl+P and Ctrl+N is related.

Traceback (most recent call last):' '.join(slugs)}")
  File "/app/.heroku/python/lib/python3.14/_pyrepl/readline.py", line 395, in multiline_input
    return reader.readline()
           ~~~~~~~~~~~~~~~^^
  File "/app/.heroku/python/lib/python3.14/_pyrepl/reader.py", line 758, in readline
    self.handle1()
    ~~~~~~~~~~~~^^
  File "/app/.heroku/python/lib/python3.14/_pyrepl/reader.py", line 741, in handle1
    self.do_cmd(cmd)
    ~~~~~~~~~~~^^^^^
  File "/app/.heroku/python/lib/python3.14/_pyrepl/reader.py", line 671, in do_cmd
    self.refresh()
    ~~~~~~~~~~~~^^
  File "/app/.heroku/python/lib/python3.14/_pyrepl/reader.py", line 649, in refresh
    self.console.refresh(self.screen, self.cxy)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.heroku/python/lib/python3.14/_pyrepl/unix_console.py", line 315, in refresh
    self.__move(0, y)
    ~~~~~~~~~~~^^^^^^
  File "/app/.heroku/python/lib/python3.14/_pyrepl/unix_console.py", line 775, in __move_tall
    assert 0 <= y - self.__offset < self.height, y - self.__offset
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: -24

I hit Ctrl+P 5 times and then hit Ctrl+N 2 times and saw the above error.

Before this I had pasted a block of code (~27 lines) and some single lines and smaller blocks.

I believe I have hit this error in both Python 3.14 and Python 3.15. I am uncertain whether I ever experienced it in 3.13.

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions