[python-win32] Catching SIGBREAK with Python 3.3

Tim Golden mail at timgolden.me.uk
Wed Nov 14 21:23:25 CET 2012


On 14/11/2012 16:47, Stefan Scherfke wrote:
> It seems like the sleep()-call cannot be interrupted. I added the changes you
> described to my code. Under XP, Py33 32bit, the child process takes 10s to
> terminate but doesn’t prints the last message. If I replace the sleep(10) call
> with a "for i in range(10): sleep(1)", the child terminates after the first
> call.
>
> Python 2.7 (32bit, winxp) however can interrupt the sleep(10)-call immediately.

Without the time to dig too deeply at the moment, I assume it's an odd 
interaction between the CRT implementation of the signal handler and the 
code, newly-added for Python 3.3, specifically to allow Ctrl-C to 
interrupt time.sleep. I'll try to dig a bit more when I have some time.

TJG



More information about the python-win32 mailing list