[issue29926] IDLE: in shell, time.sleep ignores _thread.interrupt_main()

Martin Panter report at bugs.python.org
Sat Jul 1 02:20:36 EDT 2017


Martin Panter added the comment:

I doubt the Gnu Readline library nor Python’s readline module are relevant. The input function only uses Readline if sys.stdin is the original stdin terminal; I suspect Idle monkey-patches sys.stdin. The readline method reads directly from the file object; it never uses the Readline library (despite the unfortunate clash in names :).

Louie seems to have added two workarounds: the finish flag, and using interrupt_main with a timeout. Both seem racy. What if the flag is altered in another thread between when the flag is checked and when it is acted upon? What has to happen in the 0.2 s between calling interrupt_main and raising SIGINT?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29926>
_______________________________________


More information about the Python-bugs-list mailing list