Author vstinner
Recipients Bernt.Røskar.Brenna, astrand, gps, neologix, r.david.murray, sbt, tim.golden, vstinner
Date 2013-11-18.10:48:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1384771739.21.0.89791046406.issue19575@psf.upfronthosting.co.za>
In-reply-to
Content
Ok, this issue is the corner case of the PEP 446:
http://www.python.org/dev/peps/pep-0446/#only-inherit-some-handles-on-windows

The PEP explicitly does nothing for this case. It can change in the future.

Until the point is fixed, you have to use a lock around the code spawning new processes to avoid that two threads spawn two processes and inherit unexpected files.

Example: Thread 1 creates file 1, thread 2 creates file 2, child process inherits files 1 and 2, instead of just file 1.

Richard proposed to use a trampoline process, the parent process would it the handles to inherit. Since Windows Vista, the trampoline process is no more needed.
History
Date User Action Args
2013-11-18 10:48:59vstinnersetrecipients: + vstinner, astrand, gps, tim.golden, r.david.murray, Bernt.Røskar.Brenna, neologix, sbt
2013-11-18 10:48:59vstinnersetmessageid: <1384771739.21.0.89791046406.issue19575@psf.upfronthosting.co.za>
2013-11-18 10:48:59vstinnerlinkissue19575 messages
2013-11-18 10:48:58vstinnercreate