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 eryksun
Recipients Ernst.Sjöstrand, amaury.forgeotdarc, brian.curtin, erickt, eryksun, giampaolo.rodola, guettli, neologix, vstinner, xuanji
Date 2017-04-24.18:30:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1493058607.42.0.368856189793.issue5115@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-04-24 18:30:07eryksunsetrecipients: + eryksun, guettli, amaury.forgeotdarc, vstinner, giampaolo.rodola, erickt, brian.curtin, neologix, xuanji, Ernst.Sjöstrand
2017-04-24 18:30:07eryksunsetmessageid: <1493058607.42.0.368856189793.issue5115@psf.upfronthosting.co.za>
2017-04-24 18:30:07eryksunlinkissue5115 messages
2017-04-24 18:30:07eryksuncreate