Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
--- /dev/null
+Fix :func:`time.strftime` and :meth:`datetime.datetime.strftime` returning a
+wrong ISO 8601 week number (``%V``) on OpenBSD.
the C library strftime function.\n"
#ifdef HAVE_STRFTIME
+// gh-154460: OpenBSD's wcsftime() computes %V incorrectly: it returns 53
+// whenever the ISO 8601 week belongs to a different year than tm_year.
+// strftime() is not affected.
+#ifdef __OpenBSD__
+# undef HAVE_WCSFTIME
+#endif
+
#ifdef HAVE_WCSFTIME
#define time_char wchar_t
#define format_time wcsftime