]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46659: test.support avoids locale.getdefaultlocale() (GH-31167)
authorVictor Stinner <vstinner@python.org>
Sun, 6 Feb 2022 20:51:56 +0000 (21:51 +0100)
committerGitHub <noreply@github.com>
Sun, 6 Feb 2022 20:51:56 +0000 (21:51 +0100)
skip_if_buggy_ucrt_strfptime() of test.support now uses
locale.getpreferredencoding(False) instead of
locale.getdefaultlocale() to get the Windows code page.

Lib/test/support/__init__.py

index 9d0d3d9c9b61930c6b677909071d73061e796535..d80472d8776f6c33953a995d81088293052aba61 100644 (file)
@@ -1421,7 +1421,7 @@ def skip_if_buggy_ucrt_strfptime(test):
     global _buggy_ucrt
     if _buggy_ucrt is None:
         if(sys.platform == 'win32' and
-                locale.getdefaultlocale()[1]  == 'cp65001' and
+                locale.getpreferredencoding(False)  == 'cp65001' and
                 time.localtime().tm_zone == ''):
             _buggy_ucrt = True
         else: