Eryk Sun added the comment:

Using a Windows job object should be paired with the creation flag 
CREATE_SUSPENDED. Callers may also need CREATE_BREAKAWAY_FROM_JOB, but setting 
that creation flag shouldn't be integrated into Popen.

The child has to be created suspended to ensure it doesn't spawn another 
process and exit before it's added to the job. Once it's in the job, call 
ResumeThread to start it. 

On Windows Vista and 7, the child may need to break away from Python's current 
job, if allowed. These older versions of Windows don't implement nested jobs, 
so adding the child to a job will fail if it's already in one. The job used by 
py.exe for python.exe isn't a problem in this case since it's configured for 
child processes to automatically break away, but python.exe may have been 
started directly and added to a job that's not configured for silent breakaway.

----------
nosy: +eryksun
versions: +Python 3.7 -Python 3.3

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

Reply via email to