Author vstinner
Recipients Bernt.Røskar.Brenna, sbt, vstinner
Date 2013-11-25.09:01:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1385370115.99.0.757096187315.issue19764@psf.upfronthosting.co.za>
In-reply-to
Content
subprocess.Popen has a race condition on Windows with file descriptors: if two threads spawn subprocesses at the same time, unwanted file descriptors may be inherited, which lead to annoying issues like "cannot delete a file because it is open by another process". For the issue #19575 for an example of such bug.

Since Windows Vista, a list of handle which should be inherited can be specified in CreateProcess() using PROC_THREAD_ATTRIBUTE_HANDLE_LIST with STARTUPINFOEX. It avoids the need to mark the handle temporarly inheritable.

For more information, see:
http://www.python.org/dev/peps/pep-0446/#only-inherit-some-handles-on-windows
History
Date User Action Args
2013-11-25 09:01:56vstinnersetrecipients: + vstinner, Bernt.Røskar.Brenna, sbt
2013-11-25 09:01:55vstinnersetmessageid: <1385370115.99.0.757096187315.issue19764@psf.upfronthosting.co.za>
2013-11-25 09:01:55vstinnerlinkissue19764 messages
2013-11-25 09:01:55vstinnercreate