Simon Arlott <python.si...@arlott.org> added the comment:

Access to rl_reset_line_state (and possibly others in the Redisplay
section) are also required, otherwise it's not possible to recover from
KeyboardInterrupt during raw_input() if readline isn't in the expected
editing mode.

Example:
  1. call raw_input() and use ctrl-R (reverse-i-search)
  2. catch a KeyboardInterrupt
  3. call raw_input() again

The input editing is still in reverse-i-search mode.
This makes it impractical to use raw_input() again after
KeyboardInterrupt because the input buffer may be in an unknown state.
If the history is modified then the search will break and character
input will appear to be ignored.

Note: It may be desirable to stay in this mode and call raw_input()
again, ignoring KeyboardInterrupt entirely (although the prompt is
redisplayed when exiting search mode so that doesn't currently work
cleanly), so it can't just auto-reset on KeyboardInterrupt.

The documentation should explain how to resume after KeyboardInterrupt
safely.

----------
nosy: +lp0

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1175004>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to