summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_subprocess.py
diff options
context:
space:
mode:
authorRoss Lagerwall <rosslagerwall@gmail.com>2011-04-05 14:07:49 (GMT)
committerRoss Lagerwall <rosslagerwall@gmail.com>2011-04-05 14:07:49 (GMT)
commit0b9ea93a642d2d11e694b6c469b2419401d59f8d (patch)
treebb183de99dfacbf1e69ed87038ef6c38d0d5e330 /Lib/test/test_subprocess.py
parent7a8d08110c08941a5cf4a0785684c81ce0748dfa (diff)
parent02ba73c0ef4e5b6822b585e99f3bd520e83a1c2e (diff)
downloadcpython-0b9ea93a642d2d11e694b6c469b2419401d59f8d.zip
cpython-0b9ea93a642d2d11e694b6c469b2419401d59f8d.tar.gz
cpython-0b9ea93a642d2d11e694b6c469b2419401d59f8d.tar.bz2
Merge with 3.2
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 9729c9a..e8abfef 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -720,6 +720,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):