This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Mark
Recipients Mark, terry.reedy
Date 2017-03-27.22:51:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1490655071.78.0.435370193059.issue29926@psf.upfronthosting.co.za>
In-reply-to
Content
Consider the following code, typed interactively:

>>> import time
>>> time.sleep(1e6)

This will sleep for a bit over one and a half weeks.  If this was typed in error, you may want to interrupt it.  If using the command line, this is easy: just use Ctrl-C.  If using IDLE, Ctrl-C has no effect.  One could attempt to restart the shell with Ctrl-F6, which seems to work, but in fact the process remains in the background, hung until the timeout expires.  There are two obvious workarounds: one is to sleep in a separate thread, so as to avoid blocking the main thread, and the other is to use a loop with smaller sleep increments:

for ii in range(1e5): sleep(10)

Now it only takes 10 seconds to interrupt a sleep.  But these are both clumsy workarounds.  They're so clumsy that I think I'm not going to use IDLE for this particular program and just use python -I.  Would be nice if this were fixed.
History
Date User Action Args
2017-03-27 22:51:11Marksetrecipients: + Mark, terry.reedy
2017-03-27 22:51:11Marksetmessageid: <1490655071.78.0.435370193059.issue29926@psf.upfronthosting.co.za>
2017-03-27 22:51:11Marklinkissue29926 messages
2017-03-27 22:51:11Markcreate