gh-154460: Do not use wcsftime() on OpenBSD#154461
Merged
Merged
Conversation
OpenBSD's wcsftime() computes the ISO 8601 week number (%V) incorrectly, while its strftime() is correct. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
serhiy-storchaka
requested review from
StanFromIreland and
pganssle
as code owners
July 22, 2026 09:46
Member
Co-authored-by: Stan Ulbrych <stan@python.org>
Member
Author
|
Yes, I referred the old issue. I reported the bug upstream again, this time with a simple 2-line fix. |
|
Thanks @serhiy-storchaka for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
|
GH-154474 is a backport of this pull request to the 3.15 branch. |
|
GH-154475 is a backport of this pull request to the 3.14 branch. |
|
GH-154476 is a backport of this pull request to the 3.13 branch. |
serhiy-storchaka
added a commit
that referenced
this pull request
Jul 22, 2026
serhiy-storchaka
added a commit
that referenced
this pull request
Jul 22, 2026
serhiy-storchaka
added a commit
that referenced
this pull request
Jul 22, 2026
Member
|
In the future, could you please wait for a CODEOWNER (me/Paul currently) to review before merging, thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenBSD's
wcsftime()returns 53 for%Vwhenever the ISO 8601 week belongs to other year thantm_year, while itsstrftime()is correct. Both carry the same obsolete XPG4-1994 override, butstrftime.cguards it with#ifdef XPG4_1994_04_09(never defined) andwcsftime.clost that guard when it was created in 2011. Reported to bugs@openbsd.org.HAVE_WCSFTIMEis used only here, and OpenBSD supports only the C and UTF-8 encodings forLC_CTYPE, so decoding the result ofstrftime()with the locale encoding is safe.Verified on OpenBSD 7.9:
%G-%Vnow matchesdate.isocalendar()for all tested dates, and 16test_strptimefailures are gone.