Repository navigation
AssertionError in __move_tall when scrolling through REPL history #131379
Copy link
Copy link
Closed
Labels
pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Steps to reproduce
mv -i ~/.python_history ~/.python_history.bakecho "difflib.get_close_matches("set", ['__module__', '__qualname__', '__annotations__', '__class__', '__class_getitem__', '__contains__', '__delattr__', '__delitem__']" > ~/.python_historyecho "poss = ['__module__', '__qualname__', '__annotations__', 'BAR', '_value2member_map_', '__members__', 'name', '__module__', '__qualname__', '__annotations__', '__module__', '__qualname__', '__annotations__', '__abs__', '__add__', '__and__', '__bool__', '__ceil__', '__class__', '__delattr__', '__dir__', '__divmod__', '__eq__', '__float__', '__floor__', '__floordiv__', '__format__', '__ge__', '__getattribute__', '__getnewargs__', '__getstate__', '__gt__', '__hash__', '__index__', '__init__', '__init_subclass__', '__int__', '__invert__', '__le__', '__lshift__', '__lt__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__', '__or__', '__pos__', '__pow__', '__radd__', '__rand__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__repr__', '__rfloordiv__', '__rlshift__', '__rmod__', '__rmul__', '__ror__', '__round__', '__rpow__', '__rrshift__', '__rshift__', '__rsub__', '__rtruediv__', '__rxor__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', '__trunc__', '__xor__', 'as_integer_ratio', 'bit_count', 'bit_length', 'conjugate', 'denominator', 'from_bytes', 'imag', 'is_integer', 'numerator', 'real', 'to_bytes', '__module__', '__qualname__', '__annotations__', '__class__', '__delattr__', '__dir__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__module__', '__qualname__', '__annotations__', '__module__', '__qualname__', '__annotations__', '__signature__', '__new__', '__init__', '_add_alias_', '_add_value_alias_', '_generate_next_value_', '_missing_', '__repr__', '__str__', '__dir__', '__format__', '__hash__', '__reduce_ex__', '__deepcopy__', '__copy__', 'name', 'value', '__module__', '__qualname__', '__annotations__', '__class__', '__delattr__', '__dir__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__module__', '__qualname__', '__annotations__', '__class__', '__delattr__', '__dir__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__']" >> ~/.python_history- Open an 80x20 terminal window (I use xfce4-terminal)
- Run
python - Press up twice to trigger an
AssertionError
Error
File "/usr/lib/python3.13/_pyrepl/unix_console.py", line 756, in __move_tall
assert 0 <= y - self.__offset < self.height, y - self.__offset
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: -1
Version info
Python 3.13.2 on Arch Linux
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
eendebakpt commentedon Mar 18, 2025
I can confirm the issue on current main branch (commit f819900) using Linux. For me I need to resize the terminal to have a small width (similar to the issue report). In the assertion triggered I have
y=1 self.__offset=2 self.height=17.With this
.python_historyfile:the same issue occurs on a standard terminal.
@pablogsal
pablogsal commentedon Mar 18, 2025
CC @ambv @lysnikolaou
deepwzh commentedon Mar 19, 2025
I have also reproduced the issue. I submit a modification to solve this issue.
pythongh-131379: Fix assertionError in __move_tall when scrolling thr…
pythongh-131379: Fix assertionError in __move_tall when scrolling thr…
eendebakpt commentedon Jun 8, 2026
@correctmost The issue might have been fixed by #146584. Could you confirm?
correctmost commentedon Jun 9, 2026
I don't see the assertion failure when testing main (16ede81), so it seems fixed.
eendebakpt commentedon Jun 21, 2026
Marked the issue pending. If there are no further reports coming in, we can close the issue.