[docs] [issue13368] Possible problem in documentation of module subprocess, method send_signal
report at bugs.python.org
Fri Nov 11 15:19:26 CET 2011
Brian Curtin <brian at python.org> added the comment:
> But it is useless for terminating a process with os.kill() in combination with signal.SIGTERM, which corresponds to a CTRL-C-EVENT.
SIGTERM does not correspond to CTRL_C_EVENT. They may be similar in what they do, but os.kill on Windows only works with exactly CTRL_C_EVENT and CTRL_BREAK_EVENT, as this uses GenerateConsoleCtrlEvent which only works with those two values. As the documentation states, anything other than those two constants is sent to TerminateProcess. If you call os.kill with signal.SIGTERM, it would kill the process with return code 15.
I will look into adjusting the text a little, and I also need to look into the tests. I currently have CTRL_C_EVENT tests skipped, probably because I am passing the wrong process stuff as he mentioned. I had it working at some point, but I may have generalized it too far.
assignee: docs at python -> brian.curtin
stage: -> needs patch
type: -> behavior
versions: +Python 3.2, Python 3.3
Python tracker <report at bugs.python.org>
More information about the docs