[issue39182] sys.addaudithook(hook) loops indefinitely on mismatch for hook

Steve Dower report at bugs.python.org
Sat Jan 4 14:40:23 EST 2020


Steve Dower <steve.dower at python.org> added the comment:

Right, IDLE doesn't call exec/compile until _after_ the code is submitted, while the regular prompt calls it first and passes stdin as the source file (which then does a buffered read).

The loop occurs because the next action after an invalid input is to read another input, which is correct, it just doesn't (and cannot) detect the case where an error is raised _before_ the user presses Enter.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39182>
_______________________________________


More information about the Python-bugs-list mailing list