Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 84e751a

Browse files
committed
Try to fix buildbot failure (#9902)
1 parent 7c08744 commit 84e751a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/test/test_subprocess.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,10 @@ def test_undecodable_env(self):
891891
script = "import os; print(ascii(os.getenv(%s)))" % repr(key)
892892
env = os.environ.copy()
893893
env[key] = value
894+
# Force surrogate-escaping of \xFF in the child process;
895+
# otherwise it can be decoded as-is if the default locale
896+
# is latin-1.
897+
env['PYTHONFSENCODING'] = 'ascii'
894898
stdout = subprocess.check_output(
895899
[sys.executable, "-c", script],
896900
env=env)

0 commit comments

Comments
 (0)