From 7eb1bf23b8017c2b9833c7bbb1b0331e43610136 Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Tue, 1 Feb 2022 10:31:57 +0000 Subject: [PATCH] bpo-44031: fix test_tabnanny failure in non-ascii CWD (GH-31014) (cherry picked from commit 108e66b6d23efd0fc2966163ead9434b328c5f17) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> --- Lib/test/test_tabnanny.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_tabnanny.py b/Lib/test/test_tabnanny.py index 95840d6ac0c5f4..7f3308d745aa09 100644 --- a/Lib/test/test_tabnanny.py +++ b/Lib/test/test_tabnanny.py @@ -292,8 +292,8 @@ def validate_cmd(self, *args, stdout="", stderr="", partial=False): _, out, err = script_helper.assert_python_ok('-m', 'tabnanny', *args) # Note: The `splitlines()` will solve the problem of CRLF(\r) added # by OS Windows. - out = out.decode('ascii') - err = err.decode('ascii') + out = os.fsdecode(out) + err = os.fsdecode(err) if partial: for std, output in ((stdout, out), (stderr, err)): _output = output.splitlines()