Description
DontReadFromInput
only throws IOError
when read
is being used.
pyrepl
for example would raise termios.error
when it tries to use tcgetattr
- it does not read
directly:
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/home/daniel/Vcs/pyrepl-git/pyrepl/reader.py", line 482, in prepare
INTERNALERROR> self.console.prepare()
INTERNALERROR> File "/home/daniel/Vcs/pyrepl-git/pyrepl/unix_console.py", line 357, in prepare
INTERNALERROR> self.__svtermstate = tcgetattr(self.input_fd)
INTERNALERROR> File "/home/daniel/Vcs/pyrepl-git/pyrepl/fancy_termios.py", line 34, in tcgetattr
INTERNALERROR> return TermState(termios.tcgetattr(fd))
INTERNALERROR> termios.error: (25, 'Inappropriate ioctl for device')
I've tried changing this to EOFError
, which I found more appropriate (https://github.com/blueyed/pyrepl/pull/7), but then noticed that this causes pytest to consider this to be a quitting-the-debugger event (same as Ctrl-d
).
This "silent" exit was confusing when I've noticed this while stepping to pytest itself, where it would run code with set_trace
and apparently capturing output around it (another/a different issue).
I think we should maybe not use Exit
for do_EOF
(via set_quit
), but only with do_quit
as a first step. This would also give the benefit of having Ctrl-d
work differently than q
(displaying a traceback, and test summaries).
Lines 704 to 738 in 2051e30