-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
gh-52551: Use wcsftime() to implement time.strftime() on Windows #125658
Conversation
Modules/timemodule.c
Outdated
@@ -740,8 +740,7 @@ checktm(struct tm* buf) | |||
} | |||
|
|||
#ifdef MS_WINDOWS | |||
/* wcsftime() doesn't format correctly time zones, see issue #10653 */ | |||
# undef HAVE_WCSFTIME | |||
# define HAVE_WCSFTIME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are compiler warnings: 'HAVE_WCSFTIME': macro redefinition [D:\a\cpython\cpython\PCbuild_freeze_module.vcxproj]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I did not find where it was defined in C.
Is #54862 issue solved on Windows? |
What exactly is that issue about? I get no mojibake: >>> import time
>>> time.strftime('%Z')
'Фінляндія (літо)'
>>> time.tzname
('Фінляндія (зима)', 'Фінляндія (літо)') But it crashes on invalid format string (like |
Well, this was unrelated. |
I changed my Windows language to French and the timezone to UTC+14, I managed to get a non-ASCII timezone name:
So at least for this locale (French_France.1252), it works as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you for your review @vstinner. |
Uh oh!
There was an error while loading. Please reload this page.