https://github.com/python/cpython/commit/45130bf0cc050df3e9d2888039da190e557216d3
commit: 45130bf0cc050df3e9d2888039da190e557216d3
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: hugovk <[email protected]>
date: 2026-08-12T15:43:06+03:00
summary:

[3.15] gh-155491: Fix subprocess test_encoding_warning() (GH-155492) (#155506)

Co-authored-by: Victor Stinner <[email protected]>

files:
M Lib/test/test_subprocess.py

diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index b9d15764c451ab..89e0422efb3697 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -2051,8 +2051,9 @@ def test_encoding_warning(self):
             run("echo hello", shell=True, text=True)
             check_output("echo hello", shell=True, text=True)
             """)
+        env = support.make_clean_env()
         cp = subprocess.run([sys.executable, "-Xwarn_default_encoding", "-c", 
code],
-                            capture_output=True)
+                            capture_output=True, env=env)
         lines = cp.stderr.splitlines()
         self.assertEqual(len(lines), 2, lines)
         self.assertStartsWith(lines[0], b"<string>:2: EncodingWarning: ")

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to