]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-52551: Use wcsftime() to implement time.strftime() on Windows (GH-125658)
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 19 Oct 2024 08:29:51 +0000 (11:29 +0300)
committerGitHub <noreply@github.com>
Sat, 19 Oct 2024 08:29:51 +0000 (11:29 +0300)
Lib/test/test_strftime.py
Misc/NEWS.d/next/Library/2024-10-17-20-36-06.gh-issue-52551.EIVNYY.rst [new file with mode: 0644]
Modules/timemodule.c

index cebfc8927862a72735fa17040937bc2d67731a6c..752e31359cf20620cc517d18810afe480ce36072 100644 (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:
diff --git a/Misc/NEWS.d/next/Library/2024-10-17-20-36-06.gh-issue-52551.EIVNYY.rst b/Misc/NEWS.d/next/Library/2024-10-17-20-36-06.gh-issue-52551.EIVNYY.rst
new file mode 100644 (file)
index 0000000..48d3d93
--- /dev/null
@@ -0,0 +1 @@
+Use :c:func:`!wcsftime` to implement :func:`time.strftime` on Windows.
index b9d114ada0dfcd67835d47d5ccbebc346b169193..340011fc08b551dfcea23864384fe884b325728e 100644 (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\