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 rosslagerwall
Recipients docs@python, eric.araujo, gregory.p.smith, rosslagerwall, steven.k.wong
Date 2011-02-03.10:01:29
SpamBayes Score 0.0008001541
Marked as misclassified No
Message-id <1296727292.25.0.826363818484.issue7678@psf.upfronthosting.co.za>
In-reply-to
Content
The docs should be updated. This has been noted in msg54949 and http://www.enricozini.org/2009/debian/python-pipes/

Perhaps this example will make it clear:
import subprocess

p1 = subprocess.Popen(["yes"], stdout=subprocess.PIPE)
p2 = subprocess.Popen(["head"], stdin=p1.stdout, stdout=subprocess.PIPE)
#p1.stdout.close()
p1.wait()

This example hangs. "yes" writes to "head" and head reads the first 10 lines and then exits. But, "yes" does not receive a SIGPIPE because the python process still has a p1.stdout open. Thus, p1.stdout should be closed after being passed to p2.
History
Date User Action Args
2011-02-03 10:01:32rosslagerwallsetrecipients: + rosslagerwall, gregory.p.smith, eric.araujo, steven.k.wong, docs@python
2011-02-03 10:01:32rosslagerwallsetmessageid: <1296727292.25.0.826363818484.issue7678@psf.upfronthosting.co.za>
2011-02-03 10:01:29rosslagerwalllinkissue7678 messages
2011-02-03 10:01:29rosslagerwallcreate