Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Open
Description
Bug report
Bug description:
If, in the REPL, you:
- Delete the current word, backward, on an empty line using Control-W, then
- Delete to the end of line, using Control-K
The REPL will crash with an exception in readline.
Note: ^ denotes pressing the Control or Command key when pressing the next character.
>>>^W^KTraceback (mostrecentcalllast):File"<frozen runpy>",line198,in_run_module_as_mainFile"<frozen runpy>",line88,in_run_codeFile"/usr/lib64/python3.13/_pyrepl/__main__.py",line6,in<module>__pyrepl_interactive_console()~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^File"/usr/lib64/python3.13/_pyrepl/main.py",line59,ininteractive_consolerun_multiline_interactive_console(console)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^File"/usr/lib64/python3.13/_pyrepl/simple_interact.py",line143,inrun_multiline_interactive_consolestatement=multiline_input(more_lines,ps1,ps2)File"/usr/lib64/python3.13/_pyrepl/readline.py",line389,inmultiline_inputreturnreader.readline()~~~~~~~~~~~~~~~^^File"/usr/lib64/python3.13/_pyrepl/reader.py",line802,inreadlineself.handle1()~~~~~~~~~~~~^^File"/usr/lib64/python3.13/_pyrepl/reader.py",line785,inhandle1self.do_cmd(cmd)~~~~~~~~~~~^^^^^File"/usr/lib64/python3.13/_pyrepl/reader.py",line710,indo_cmdcommand.do()~~~~~~~~~~^^File"/usr/lib64/python3.13/_pyrepl/commands.py",line157,indoself.kill_range(r.pos,eol+1)~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^File"/usr/lib64/python3.13/_pyrepl/commands.py",line71,inkill_ranger.kill_ring[-1]=r.kill_ring[-1]+text~~~~~~~~~~~^^^^
This exception is caused sincekill_range
is not called on an emptybackward_kill_word
, causingkill_ring
to be empty:https://github.com/pypy/pyrepl/blob/ca192a80b76700118b9bfd261a3d098b92ccfc31/pyrepl/commands.py#L152-L156
CPython versions tested on:
3.13
Operating systems tested on:
Linux