Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedOct 17, 2024
edited by bedevere-appbot
Loading

#ifdefMS_WINDOWS
/* wcsftime() doesn't format correctly time zones, see issue #10653 */
# undef HAVE_WCSFTIME
# defineHAVE_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
MemberAuthor

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
MemberAuthor

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
MemberAuthor

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>pythonPython 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

@vstinnervstinner 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
MemberAuthor

Thank you for your review@vstinner.

@serhiy-storchakaserhiy-storchaka merged commita7443a1 intopython:mainOct 19, 2024
39 checks passed
@serhiy-storchakaserhiy-storchaka deleted the strftime-windows-wcsftime branchOctober 19, 2024 08:29
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@vstinnervstinnervstinner approved these changes

@pgansslepganssleAwaiting requested review from pgansslepganssle is a code owner

@abalkinabalkinAwaiting requested review from abalkinabalkin is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@serhiy-storchaka@vstinner

[8]ページ先頭

©2009-2025 Movatter.jp