From: Victor Stinner Date: Sun, 6 Feb 2022 20:51:56 +0000 (+0100) Subject: bpo-46659: test.support avoids locale.getdefaultlocale() (GH-31167) X-Git-Tag: v3.11.0a6~299 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=06b8f1615b09099fae5c5393334b8716a4144d20;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 9d0d3d9c9b61..d80472d8776f 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: