[issue10653] test_time test_strptime fails on windows

Eryk Sun report at bugs.python.org
Sun Mar 7 07:36:19 EST 2021


Eryk Sun <eryksun at gmail.com> added the comment:

Update since msg243660: 

Python 3.8+ now calls setlocale(LC_CTYPE, "") at startup in Windows, as it has always done in POSIX, so decoding the output of strftime("%Z") with PyUnicode_DecodeLocaleAndSize() works again since both agree on using the process active code page. 

In 3.7+, per bpo-36779, time.tzname is set when the module is first loaded by directly querying GetTimeZoneInformation(). time.tzset() is still not supported, despite the fact that it was always supported by ucrt, so this value can become stale relative to strftime("%Z").

Starting with Windows 10 v2004 (build 19041), ucrt uses an internal wide-character version of the time-zone name that gets returned by an internal __wide_tzname() call and used for "%Z" in wcsftime(). The wide-character value gets updated by _tzset() and kept in sync with _tzname.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue10653>
_______________________________________


More information about the Python-bugs-list mailing list