Message203276
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. |
|
Date |
User |
Action |
Args |
2013-11-18 10:48:59 | vstinner | set | recipients:
+ vstinner, astrand, gps, tim.golden, r.david.murray, Bernt.Røskar.Brenna, neologix, sbt |
2013-11-18 10:48:59 | vstinner | set | messageid: <1384771739.21.0.89791046406.issue19575@psf.upfronthosting.co.za> |
2013-11-18 10:48:59 | vstinner | link | issue19575 messages |
2013-11-18 10:48:58 | vstinner | create | |
|