Eryk Sun <eryk...@gmail.com> added the comment:

For a console application, normally the system connects to either the console 
that's inherited from the parent or, if no console is inherited, a newly 
allocated console. The creation flag DETACHED_PROCESS sets the initial console 
handle in the child to a special value that tells the system to skip connecting 
to a console. If the child process doesn't subsequently call AllocConsole, 
AttachConsole, or create a visible top-level window, then it will considered to 
be background process. 

Note that 'detached' in this case doesn't mean detached from the parent 
process. There's no such attachment to begin with because Windows does not 
maintain a process tree. It uses a nested job-object hierarchy as the 
equivalent of a Unix process tree. The creation flag CREATE_BREAKAWAY_FROM_JOB 
breaks away from jobs that allow it.

The Popen warning is a tool to help programmers become aware of leaked child 
processes. I do think there should be a documented way to disable this warning 
for a child process. However, this is unrelated to the DETACHED_PROCESS flag.

----------
nosy: +eryksun

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

Reply via email to