New submission from Eli Bendersky <eli...@gmail.com>:

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.

----------
assignee: docs@python
components: Documentation
messages: 147272
nosy: docs@python, eli.bendersky
priority: normal
severity: normal
status: open
title: Possible problem in documentation of module subprocess, method 
send_signal
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13368>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to