Skip to content

Commit 45130bf

Browse files
[3.15] gh-155491: Fix subprocess test_encoding_warning() (GH-155492) (#155506)
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 927e833 commit 45130bf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/test/test_subprocess.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2051,8 +2051,9 @@ def test_encoding_warning(self):
20512051
run("echo hello", shell=True, text=True)
20522052
check_output("echo hello", shell=True, text=True)
20532053
""")
2054+
env = support.make_clean_env()
20542055
cp = subprocess.run([sys.executable, "-Xwarn_default_encoding", "-c", code],
2055-
capture_output=True)
2056+
capture_output=True, env=env)
20562057
lines = cp.stderr.splitlines()
20572058
self.assertEqual(len(lines), 2, lines)
20582059
self.assertStartsWith(lines[0], b"<string>:2: EncodingWarning: ")

0 commit comments

Comments
 (0)