[New-bugs-announce] [issue18411] signal.SIGINT in windows cause process exit directly.

guo tie report at bugs.python.org
Tue Jul 9 08:32:31 CEST 2013


New submission from guo tie:

I wrote those test python code as following:

import signal
import time
import os

def handler(signum, frame):
    print "do whatever, like call thread.interrupt_main()"
    return

signal.signal(signal.SIGINT, handler)

while 1:
    try:
        time.sleep(10)
    except:
        os.kill(int(os.getpid()), signal.SIGINT)
        pass


when i excute this test code on windows, the process print "do whatever, like call thread.interrupt_main()", then exit;
on linux, it works correctly.

why on windows it not work?

----------
components: Windows
messages: 192722
nosy: guo.tie
priority: normal
severity: normal
status: open
title: signal.SIGINT in windows cause process exit directly.
type: behavior
versions: Python 2.7

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


More information about the New-bugs-announce mailing list