gh-91156: Use locale.getencoding() instead of getpreferredencoding (GH-91732)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Inada Naoki 2022-04-22 10:39:24 +09:00 committed by GitHub
parent efe7fd4170
commit 1317b70f89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 29 additions and 44 deletions

View file

@ -1445,7 +1445,7 @@ def skip_if_buggy_ucrt_strfptime(test):
global _buggy_ucrt
if _buggy_ucrt is None:
if(sys.platform == 'win32' and
locale.getpreferredencoding(False) == 'cp65001' and
locale.getencoding() == 'cp65001' and
time.localtime().tm_zone == ''):
_buggy_ucrt = True
else: