Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Lib/test/test_strftime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use :c:func:`!wcsftime` to implement :func:`time.strftime` on Windows.
4 changes: 0 additions & 4 deletions Modules/timemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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\
Expand Down
Loading