Skip to content

Commit

Permalink
bpo-46659: test.support avoids locale.getdefaultlocale() (GH-31167)
Browse files Browse the repository at this point in the history
skip_if_buggy_ucrt_strfptime() of test.support now uses
locale.getpreferredencoding(False) instead of
locale.getdefaultlocale() to get the Windows code page.
  • Loading branch information
vstinner authored Feb 6, 2022
1 parent 04dd60e commit 06b8f16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 06b8f16

Please sign in to comment.