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 meilyadam
Recipients meilyadam
Date 2015-08-21.16:57:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1440176248.84.0.611662646456.issue24909@psf.upfronthosting.co.za>
In-reply-to
Content
Attached is a test Python script that you can run to see the race condition in action. There are two Python scripts: pipe.py and reader.py.

 - pipe.py: make two subprocess.Popen() calls from two different threads.

 - reader.py: (its content is in the bottom comments of pipe.py, so move it to a separate file): reads lines from stdin and exits

Basically, pipe.py creates a pipe between "echo Hello World!" and "python reader.py".

You'll see that pipe.py will hang until ctrl+c is entered, even though the first subprocess in the pipe, reader.py, exits. Uncommenting the time.sleep() call will cause the first subprocess.Popen() time to properly close the inheritable handles before the second subprocess.Popen() call is made in the other thread, thus the inheritable handles are leaked.
History
Date User Action Args
2015-08-21 16:57:28meilyadamsetrecipients: + meilyadam
2015-08-21 16:57:28meilyadamsetmessageid: <1440176248.84.0.611662646456.issue24909@psf.upfronthosting.co.za>
2015-08-21 16:57:28meilyadamlinkissue24909 messages
2015-08-21 16:57:28meilyadamcreate