mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-31471: Fix assertion failure in subprocess.Popen() on Windows, in case env has a bad keys() method. (#3580)
This commit is contained in:
parent
f350a268a7
commit
0b3a87ef54
3 changed files with 16 additions and 1 deletions
|
@ -2742,6 +2742,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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue