Skip to content

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Oct 17, 2024

#ifdef MS_WINDOWS
/* wcsftime() doesn't format correctly time zones, see issue #10653 */
# undef HAVE_WCSFTIME
# define HAVE_WCSFTIME
Copy link
Member

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]

Copy link
Member Author

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.

@vstinner
Copy link
Member

Is #54862 issue solved on Windows?

@serhiy-storchaka
Copy link
Member Author

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 %f).

@serhiy-storchaka
Copy link
Member Author

But it crashes on invalid format string (like %f).

Well, this was unrelated.

@vstinner
Copy link
Member

Is #54862 issue solved on Windows?

I changed my Windows language to French and the timezone to UTC+14, I managed to get a non-ASCII timezone name:

vstinner@WIN C:\victor\python\main>python
Python 3.14.0a1+ (heads/pr/125658:0e1bdf72d94, Oct 18 2024, 16:46:59) [MSC v.1941 64 bit (AMD64)] on win32
>>> import time; time.strftime("%Z")
'Îles de la Ligne '

So at least for this locale (French_France.1252), it works as expected.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@serhiy-storchaka
Copy link
Member Author

Thank you for your review @vstinner.

@serhiy-storchaka serhiy-storchaka merged commit a7443a1 into python:main Oct 19, 2024
39 checks passed
@serhiy-storchaka serhiy-storchaka deleted the strftime-windows-wcsftime branch October 19, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants