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 eli.bendersky
Recipients docs@python, eli.bendersky
Date 2011-11-08.03:23:13
SpamBayes Score 0.00115228
Marked as misclassified No
Message-id <1320722594.89.0.739080107592.issue13368@psf.upfronthosting.co.za>
In-reply-to
Content
docs@ list report by Daniel Dieterle:

in the documentation (http://docs.python.org/library/subprocess.html#subprocess.Popen.send_signal) is a bug.

CTRL_C_EVENT can not be sent to processes started with a creationflags parameter which includes CREATE_NEW_PROCESS_GROUP. Why can be read in the msdn documentation http://msdn.microsoft.com/en-us/library/windows/desktop/ms683155%28v=vs.85%29.aspx .

A workaround using CTRL_C_EVENT nevertheless is described here:
http://stackoverflow.com/questions/7085604/sending-c-to-python-subprocess-objects-on-windows/7980368#7980368 

--

I do not know why the subprocess.CREATE_NEW_PROCESS_GROUP parameter was introduced. But it is useless for terminating a process with os.kill() in combination with signal.SIGTERM, which corresponds to a CTRL-C-EVENT.
A CTRL-C-EVENT is only forwarded to the process if the process group is zero. Therefore the Note in the documentation on Popen.send_signal() is wrong.
History
Date User Action Args
2011-11-08 03:23:14eli.benderskysetrecipients: + eli.bendersky, docs@python
2011-11-08 03:23:14eli.benderskysetmessageid: <1320722594.89.0.739080107592.issue13368@psf.upfronthosting.co.za>
2011-11-08 03:23:14eli.benderskylinkissue13368 messages
2011-11-08 03:23:13eli.benderskycreate