[3.9] bpo-44031: fix test_tabnanny failure in non-ascii CWD (GH-31014) (GH-31048)

(cherry picked from commit 108e66b6d2)


Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>

Automerge-Triggered-By: GH:iritkatriel
This commit is contained in:
Miss Islington (bot) 2022-02-01 03:31:49 -08:00 committed by GitHub
parent 2532b7c820
commit 2e9f77f9d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -292,8 +292,8 @@ class TestCommandLine(TestCase):
_, 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()