gh-52551: Use wcsftime() to implement time.strftime() on Windows (GH-125658)

This commit is contained in:
Serhiy Storchaka 2024-10-19 11:29:51 +03:00 committed by GitHub
parent 84074a4fd8
commit a7443a1735
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2 additions and 6 deletions

View File

@ -183,8 +183,7 @@ class Y1900Tests(unittest.TestCase):
def test_y_before_1900(self):
# Issue #13674, #19634
t = (1899, 1, 1, 0, 0, 0, 0, 0, 0)
if (sys.platform == "win32"
or sys.platform.startswith(("aix", "sunos", "solaris"))):
if sys.platform.startswith(("aix", "sunos", "solaris")):
with self.assertRaises(ValueError):
time.strftime("%y", t)
else:

View File

@ -0,0 +1 @@
Use :c:func:`!wcsftime` to implement :func:`time.strftime` on Windows.

View File

@ -739,10 +739,6 @@ checktm(struct tm* buf)
return 1;
}
#ifdef MS_WINDOWS
/* wcsftime() doesn't format correctly time zones, see issue #10653 */
# undef HAVE_WCSFTIME
#endif
#define STRFTIME_FORMAT_CODES \
"Commonly used format codes:\n\
\n\