summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-02-06 20:51:56 (GMT)
committerGitHub <noreply@github.com>2022-02-06 20:51:56 (GMT)
commit06b8f1615b09099fae5c5393334b8716a4144d20 (patch)
tree7e2d4fd8e53849cbe8ede14756aaf5a24acb3c07 /Lib
parent04dd60e50cd3da48fd19cdab4c0e4cc600d6af30 (diff)
downloadcpython-06b8f1615b09099fae5c5393334b8716a4144d20.zip
cpython-06b8f1615b09099fae5c5393334b8716a4144d20.tar.gz
cpython-06b8f1615b09099fae5c5393334b8716a4144d20.tar.bz2
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.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/support/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 9d0d3d9..d80472d 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: