Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.1k
Closed
Description
Bug report
Bug description:
Running python REPL under another program (strace ./build/python in my case), then pressing Ctrl-C on Linux results in an infinite stream of exception tracebacks.
Tested on Python 3.13 branch and main
Duringhandlingoftheaboveexception,anotherexceptionoccurred:Traceback (mostrecentcalllast):File"/build/python/cpython/Lib/_pyrepl/readline.py",line394,inmultiline_inputreturnreader.readline()~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line742,inreadlineself.prepare()~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/historical_reader.py",line306,inpreparesuper().prepare()~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line594,inprepareself.restore()~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line608,inrestoreself.console.restore()~~~~~~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/unix_console.py",line371,inrestoretcsetattr(self.input_fd,termios.TCSADRAIN,self.__svtermstate)~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/build/python/cpython/Lib/_pyrepl/fancy_termios.py",line57,intcsetattrtermios.tcsetattr(fd,when,attrs.as_list())~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^termios.error: (5,'Input/output error')Traceback (mostrecentcalllast):File"/build/python/cpython/Lib/_pyrepl/reader.py",line585,inprepareself.console.prepare()~~~~~~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/unix_console.py",line339,inpreparetcsetattr(self.input_fd,termios.TCSADRAIN,raw)~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/build/python/cpython/Lib/_pyrepl/fancy_termios.py",line57,intcsetattrtermios.tcsetattr(fd,when,attrs.as_list())~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^termios.error: (5,'Input/output error')Duringhandlingoftheaboveexception,anotherexceptionoccurred:Traceback (mostrecentcalllast):File"/build/python/cpython/Lib/_pyrepl/readline.py",line394,inmultiline_inputreturnreader.readline()~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line742,inreadlineself.prepare()~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/historical_reader.py",line306,inpreparesuper().prepare()~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line594,inprepareself.restore()~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line608,inrestoreself.console.restore()~~~~~~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/unix_console.py",line371,inrestoretcsetattr(self.input_fd,termios.TCSADRAIN,self.__svtermstate)~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/build/python/cpython/Lib/_pyrepl/fancy_termios.py",line57,intcsetattrtermios.tcsetattr(fd,when,attrs.as_list())~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^termios.error: (5,'Input/output error')Traceback (mostrecentcalllast):File"/build/python/cpython/Lib/_pyrepl/reader.py",line585,inprepareself.console.prepare()~~~~~~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/unix_console.py",line339,inpreparetcsetattr(self.input_fd,termios.TCSADRAIN,raw)~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/build/python/cpython/Lib/_pyrepl/fancy_termios.py",line57,intcsetattrtermios.tcsetattr(fd,when,attrs.as_list())~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^termios.error: (5,'Input/output error')Duringhandlingoftheaboveexception,anotherexceptionoccurred:Traceback (mostrecentcalllast):File"/build/python/cpython/Lib/_pyrepl/readline.py",line394,inmultiline_inputreturnreader.readline()~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line742,inreadlineself.prepare()~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/historical_reader.py",line306,inpreparesuper().prepare()~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line594,inprepareself.restore()~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line608,inrestoreself.console.restore()~~~~~~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/unix_console.py",line371,inrestoretcsetattr(self.input_fd,termios.TCSADRAIN,self.__svtermstate)~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/build/python/cpython/Lib/_pyrepl/fancy_termios.py",line57,intcsetattrtermios.tcsetattr(fd,when,attrs.as_list())~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^termios.error: (5,'Input/output error')Traceback (mostrecentcalllast):File"/build/python/cpython/Lib/_pyrepl/reader.py",line585,inprepareself.console.prepare()~~~~~~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/unix_console.py",line339,inpreparetcsetattr(self.input_fd,termios.TCSADRAIN,raw)~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/build/python/cpython/Lib/_pyrepl/fancy_termios.py",line57,intcsetattrtermios.tcsetattr(fd,when,attrs.as_list())~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^termios.error: (5,'Input/output error')Duringhandlingoftheaboveexception,anotherexceptionoccurred:Traceback (mostrecentcalllast):File"/build/python/cpython/Lib/_pyrepl/readline.py",line394,inmultiline_inputreturnreader.readline()~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line742,inreadlineself.prepare()~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/historical_reader.py",line306,inpreparesuper().prepare()~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line594,inprepareself.restore()~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line608,inrestoreself.console.restore()~~~~~~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/unix_console.py",line371,inrestoretcsetattr(self.input_fd,termios.TCSADRAIN,self.__svtermstate)~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/build/python/cpython/Lib/_pyrepl/fancy_termios.py",line57,intcsetattrtermios.tcsetattr(fd,when,attrs.as_list())~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^termios.error: (5,'Input/output error')Traceback (mostrecentcalllast):File"/build/python/cpython/Lib/_pyrepl/reader.py",line585,inprepareself.console.prepare()~~~~~~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/unix_console.py",line339,inpreparetcsetattr(self.input_fd,termios.TCSADRAIN,raw)~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/build/python/cpython/Lib/_pyrepl/fancy_termios.py",line57,intcsetattrtermios.tcsetattr(fd,when,attrs.as_list())~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^termios.error: (5,'Input/output error')Duringhandlingoftheaboveexception,anotherexceptionoccurred:Traceback (mostrecentcalllast):File"/build/python/cpython/Lib/_pyrepl/readline.py",line394,inmultiline_inputreturnreader.readline()~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line742,inreadlineself.prepare()~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/historical_reader.py",line306,inpreparesuper().prepare()~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line594,inprepareself.restore()~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line608,inrestoreself.console.restore()~~~~~~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/unix_console.py",line371,inrestoretcsetattr(self.input_fd,termios.TCSADRAIN,self.__svtermstate)~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/build/python/cpython/Lib/_pyrepl/fancy_termios.py",line57,intcsetattrtermios.tcsetattr(fd,when,attrs.as_list())~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^termios.error: (5,'Input/output error')Traceback (mostrecentcalllast):File"/build/python/cpython/Lib/_pyrepl/reader.py",line585,inprepareself.console.prepare()~~~~~~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/unix_console.py",line339,inpreparetcsetattr(self.input_fd,termios.TCSADRAIN,raw)~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/build/python/cpython/Lib/_pyrepl/fancy_termios.py",line57,intcsetattrtermios.tcsetattr(fd,when,attrs.as_list())~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^termios.error: (5,'Input/output error')Duringhandlingoftheaboveexception,anotherexceptionoccurred:Traceback (mostrecentcalllast):File"/build/python/cpython/Lib/_pyrepl/readline.py",line394,inmultiline_inputreturnreader.readline()~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line742,inreadlineself.prepare()~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/historical_reader.py",line306,inpreparesuper().prepare()~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line594,inprepareself.restore()~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/reader.py",line608,inrestoreself.console.restore()~~~~~~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/unix_console.py",line371,inrestoretcsetattr(self.input_fd,termios.TCSADRAIN,self.__svtermstate)~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/build/python/cpython/Lib/_pyrepl/fancy_termios.py",line57,intcsetattrtermios.tcsetattr(fd,when,attrs.as_list())~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^termios.error: (5,'Input/output error')Traceback (mostrecentcalllast):File"/build/python/cpython/Lib/_pyrepl/reader.py",line585,inprepareself.console.prepare()~~~~~~~~~~~~~~~~~~~~^^File"/build/python/cpython/Lib/_pyrepl/unix_console.py",line339,inpreparetcsetattr(self.input_fd,termios.TCSADRAIN,raw)~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/build/python/cpython/Lib/_pyrepl/fancy_termios.py",line57,intcsetattrtermios.tcsetattr(fd,when,attrs.as_list())~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^termios.error: (5,'Input/output error')
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
- gh-135329: prevent infinite traceback loop on Ctrl-C for strace #138133
- [3.14] gh-135329: prevent infinite traceback loop on Ctrl-C for strace (GH-138133) #138973
- [3.13] gh-135329: prevent infinite traceback loop on Ctrl-C for strace #138974
- [3.13] gh-135329: prevent infinite traceback loop on Ctrl-C for strace #139028
- gh-135329: Use longer timeout in pyrepl test_repl_eio() #139503
- [3.14] gh-135329: Use longer timeout in pyrepl test_repl_eio() (GH-139503) #139506
- [3.13] gh-135329: Use longer timeout in pyrepl test_repl_eio() (#139503) #139507