summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_subprocess.py
diff options
context:
space:
mode:
authorRoss Lagerwall <rosslagerwall@gmail.com>2011-04-05 13:48:47 (GMT)
committerRoss Lagerwall <rosslagerwall@gmail.com>2011-04-05 13:48:47 (GMT)
commit02ba73c0ef4e5b6822b585e99f3bd520e83a1c2e (patch)
tree583061e85c79fe704370250dce43669cf5447f5c /Lib/test/test_subprocess.py
parent4333affb74f29d46d28ba2b202aa9ff48716cab2 (diff)
parent4f61b025203cf3fcd52eab2ece0d3f60b0bacd48 (diff)
downloadcpython-02ba73c0ef4e5b6822b585e99f3bd520e83a1c2e.zip
cpython-02ba73c0ef4e5b6822b585e99f3bd520e83a1c2e.tar.gz
cpython-02ba73c0ef4e5b6822b585e99f3bd520e83a1c2e.tar.bz2
Merge with 3.1
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r--Lib/test/test_subprocess.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 7ca3d92..4ec754c 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -626,6 +626,25 @@ class ProcessTestCase(BaseTestCase):
self.assertFalse(os.path.exists(ofname))
self.assertFalse(os.path.exists(efname))
+ def test_communicate_epipe(self):
+ # Issue 10963: communicate() should hide EPIPE
+ p = subprocess.Popen([sys.executable, "-c", 'pass'],
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
+ self.addCleanup(p.stdin.close)
+ p.communicate(b"x" * 2**20)
+
+ def test_communicate_epipe_only_stdin(self):
+ # Issue 10963: communicate() should hide EPIPE
+ p = subprocess.Popen([sys.executable, "-c", 'pass'],
+ stdin=subprocess.PIPE)
+ self.addCleanup(p.stdin.close)
+ time.sleep(2)
+ p.communicate(b"x" * 2**20)
+
# context manager
class _SuppressCoreFiles(object):