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 vstinner
Recipients BreamoreBoy, asvetlov, pitrou, r.david.murray, tim.golden, vstinner, zach.ware
Date 2014-07-23.13:45:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1406123130.01.0.0284576532858.issue14484@psf.upfronthosting.co.za>
In-reply-to
Content
I understand that os.kill(pid, sig) should call TerminateProcess() or GenerateConsoleCtrlEvent() depending on the value of sig.

The problem is that these two functions are very different. A process can set a control handler for CTRL_C_EVENT and CTRL_BREAK_EVENT, so can decide how to handle GenerateConsoleCtrlEvent() event.

TerminateProcess() kills the process with the specified exit code.

To me it looks wrong to call TerminateProcess() with a signal number or event for the exit code!? We need to expose TerminateProcess() as a new Python function, os.TerminateProcess(pid, exitcode) for example.

os.kill(pid, sig) should raise a ValueError if sig is not CTRL_C_EVENT nor CTRL_BREAK_EVENT.
History
Date User Action Args
2014-07-23 13:45:30vstinnersetrecipients: + vstinner, pitrou, tim.golden, r.david.murray, asvetlov, BreamoreBoy, zach.ware
2014-07-23 13:45:30vstinnersetmessageid: <1406123130.01.0.0284576532858.issue14484@psf.upfronthosting.co.za>
2014-07-23 13:45:29vstinnerlinkissue14484 messages
2014-07-23 13:45:29vstinnercreate