From 06b8f1615b09099fae5c5393334b8716a4144d20 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sun, 6 Feb 2022 21:51:56 +0100 Subject: [PATCH] bpo-46659: test.support avoids locale.getdefaultlocale() (GH-31167) 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 9d0d3d9c9b6..d80472d8776 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -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: