You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
_pyrepl: IndexError in max_column when recalling a very long single-line history entry #159617
On CPython 3.14.6, the default REPL (_pyrepl) crashes with IndexError when recalling a very long single-line history entry and then pressing Down repeatedly.
This reproduces with plain ASCII.
Minimal reproducer
Launch a narrow xterm:
xterm -geometry 20x10
In the Python REPL, enter a very long single line (1000 a characters on one line), e.g.:
a="""aaaa... (1000 a's, single line)"""
Press Up several times, then press Down repeatedly.
Traceback
Traceback (most recent call last):
File ".../_pyrepl/readline.py", line 395, in multiline_input
return reader.readline()
File ".../_pyrepl/reader.py", line 759, in readline
self.handle1()
File ".../_pyrepl/reader.py", line 742, in handle1
self.do_cmd(cmd)
File ".../_pyrepl/reader.py", line 667, in do_cmd
command.do()
File ".../_pyrepl/commands.py", line 299, in do
new_x := r.max_column(new_y)
File ".../_pyrepl/reader.py", line 463, in max_column
return self.screeninfo[y][0] + sum(self.screeninfo[y][1])
IndexError: list index out of range
Activity