]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.9] bpo-44031: fix test_tabnanny failure in non-ascii CWD (GH-31014) (GH-31048)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 1 Feb 2022 11:31:49 +0000 (03:31 -0800)
committerGitHub <noreply@github.com>
Tue, 1 Feb 2022 11:31:49 +0000 (03:31 -0800)
(cherry picked from commit 108e66b6d23efd0fc2966163ead9434b328c5f17)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Automerge-Triggered-By: GH:iritkatriel
Lib/test/test_tabnanny.py

index 95840d6ac0c5f4c49e8be7e07da564c433a2b615..7f3308d745aa093fb78f379aa19c3dbb40fee197 100644 (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()