bpo-44031: fix test_tabnanny failure in non-ascii CWD (GH-31014)

(cherry picked from commit 108e66b6d2)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2022-02-01 03:20:07 -08:00 committed by GitHub
parent 6a188d88c5
commit 1dcd772804
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -293,8 +293,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()