STINNER Victor added the comment:

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.

----------

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

Reply via email to