summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2017-09-14 19:56:31 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-09-14 19:56:31 (GMT)
commitf135f62cfd1529cbb9326e53728a22afd05b6bc3 (patch)
tree069cd5e8e3cba9b6f207d837cba76621128ff29e /Lib
parent20fa05d0223101b8e0005525b94a2eac892348de (diff)
downloadcpython-f135f62cfd1529cbb9326e53728a22afd05b6bc3.zip
cpython-f135f62cfd1529cbb9326e53728a22afd05b6bc3.tar.gz
cpython-f135f62cfd1529cbb9326e53728a22afd05b6bc3.tar.bz2
[3.6] bpo-31471: Fix assertion failure in subprocess.Popen() on Windows, in case env has a bad keys() method. (GH-3580) (#3584)
(cherry picked from commit 0b3a87ef54a0112b74e8a1d8c6f87d10db4239ab)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_subprocess.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index df3f750..391d08c 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -2735,6 +2735,15 @@ class Win32ProcessTestCase(BaseTestCase):
stdout=subprocess.PIPE,
close_fds=True)
+ @support.cpython_only
+ def test_issue31471(self):
+ # There shouldn't be an assertion failure in Popen() in case the env
+ # argument has a bad keys() method.
+ class BadEnv(dict):
+ keys = None
+ with self.assertRaises(TypeError):
+ subprocess.Popen([sys.executable, "-c", "pass"], env=BadEnv())
+
def test_close_fds(self):
# close file descriptors
rc = subprocess.call([sys.executable, "-c",