[3.11] gh-105436: The environment block should end with two null wchar_t values (GH-105495) (#105701)

gh-105436: The environment block should end with two null wchar_t values (GH-105495)
(cherry picked from commit 4f7d3b602d)

Co-authored-by: Dora203 <66343334+sku2000@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2023-06-12 09:49:57 -07:00 committed by GitHub
parent f5b63eab9b
commit 261d0b4f0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 1 deletions

View file

@ -1690,6 +1690,13 @@ class RunFuncTestCase(BaseTestCase):
res = subprocess.run(args)
self.assertEqual(res.returncode, 57)
@unittest.skipUnless(mswindows, "Maybe test trigger a leak on Ubuntu")
def test_run_with_an_empty_env(self):
# gh-105436: fix subprocess.run(..., env={}) broken on Windows
args = [sys.executable, "-c", 'import sys; sys.exit(57)']
res = subprocess.run(args, env={})
self.assertEqual(res.returncode, 57)
def test_capture_output(self):
cp = self.run_python(("import sys;"
"sys.stdout.write('BDFL'); "