diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index dedd3cc0e9e867..e2add09244c974 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -4132,8 +4132,10 @@ def test_getoutput(self): try: dir = tempfile.mkdtemp() name = os.path.join(dir, "foo") + # The message comes from the shell in the console code page, + # which need not be the encoding getstatusoutput() uses. status, output = subprocess.getstatusoutput( - ("type " if mswindows else "cat ") + name) + ("type " if mswindows else "cat ") + name, errors="replace") self.assertNotEqual(status, 0) finally: if dir is not None: