https://github.com/python/cpython/commit/a7443a1735c33d5758b47ac9b8a1c34bac4ef994
commit: a7443a1735c33d5758b47ac9b8a1c34bac4ef994
branch: main
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2024-10-19T11:29:51+03:00
summary:

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

files:
A Misc/NEWS.d/next/Library/2024-10-17-20-36-06.gh-issue-52551.EIVNYY.rst
M Lib/test/test_strftime.py
M Modules/timemodule.c

diff --git a/Lib/test/test_strftime.py b/Lib/test/test_strftime.py
index cebfc8927862a7..752e31359cf206 100644
--- a/Lib/test/test_strftime.py
+++ b/Lib/test/test_strftime.py
@@ -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
index 00000000000000..48d3d93c3d72af
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2024-10-17-20-36-06.gh-issue-52551.EIVNYY.rst
@@ -0,0 +1 @@
+Use :c:func:`!wcsftime` to implement :func:`time.strftime` on Windows.
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index b9d114ada0dfcd..340011fc08b551 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -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\

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to