[docs] Bug in documentation of module subprocess, method send_signal

Dieterle, Daniel Daniel.Dieterle at comsoft.aero
Mon Nov 7 09:10:06 CET 2011


Hi Eli,
 
it's not a problem of implementation, because there is no way of killing
an individual process with the CTRL-C-EVENT signal.
 
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.
 
Bye,
Daniel.
 
 
________________________________

Von: Eli Bendersky [mailto:eliben at gmail.com] 
Gesendet: Sonntag, 6. November 2011 04:28
An: Dieterle, Daniel
Cc: docs at python.org
Betreff: Re: [docs] Bug in documentation of module subprocess, method
send_signal




	in the documentation
(http://docs.python.org/library/subprocess.html#subprocess.Popen.send_si
gnal
<http://docs.python.org/library/subprocess.html#subprocess.Popen.send_si
gnal> ) 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
<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-subproces
s-objects-on-windows/7980368#7980368
<http://stackoverflow.com/questions/7085604/sending-c-to-python-subproce
ss-objects-on-windows/7980368#7980368>          
	


Hi Daniel,

If what you say is true (and I assume it is), it may be a problem with
the implementation, not only the documentation. Could you perchance
reproduce this? Perhaps an actual bug report on subprocess should be
opened, and not only a documentation fix.

Eli
 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20111107/27d0a5a5/attachment.html>


More information about the docs mailing list