From e8042329b6bb2472b16645c559e4223486b85965 Mon Sep 17 00:00:00 2001 From: Pranav Choudhary Date: Mon, 20 Jul 2026 10:24:04 +0530 Subject: [PATCH 1/2] gh-154046: docs: fix dead link to codahale timing attacks article in secrets.rst (#154047) --- Doc/library/secrets.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/secrets.rst b/Doc/library/secrets.rst index 3b5b57fb1c21702..842e8c512def139 100644 --- a/Doc/library/secrets.rst +++ b/Doc/library/secrets.rst @@ -137,7 +137,7 @@ Other functions :term:`bytes-like objects ` *a* and *b* are equal, otherwise ``False``, using a "constant-time compare" to reduce the risk of - `timing attacks `_. + `timing attacks `__. See :func:`hmac.compare_digest` for additional details. From 44ea9503bff4001c416f96d9bd604daa005106c7 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 20 Jul 2026 08:00:11 +0300 Subject: [PATCH 2/2] gh-154136: Define _ISOC23_SOURCE to fix building the math module on FreeBSD (GH-154138) Co-authored-by: Claude Fable 5 --- .../Build/2026-07-19-16-45-00.gh-issue-154136.mathpi.rst | 3 +++ configure | 7 +++++++ configure.ac | 6 ++++++ pyconfig.h.in | 3 +++ 4 files changed, 19 insertions(+) create mode 100644 Misc/NEWS.d/next/Build/2026-07-19-16-45-00.gh-issue-154136.mathpi.rst diff --git a/Misc/NEWS.d/next/Build/2026-07-19-16-45-00.gh-issue-154136.mathpi.rst b/Misc/NEWS.d/next/Build/2026-07-19-16-45-00.gh-issue-154136.mathpi.rst new file mode 100644 index 000000000000000..9bfa313873893a4 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-07-19-16-45-00.gh-issue-154136.mathpi.rst @@ -0,0 +1,3 @@ +Fix building the :mod:`math` module on FreeBSD. +Define ``_ISOC23_SOURCE`` to make the C23 library declarations +(such as ``sinpi()`` in ``math.h``) visible. diff --git a/configure b/configure index b7ba4994b30e701..71fa0b435d16505 100755 --- a/configure +++ b/configure @@ -4809,6 +4809,13 @@ printf "%s\n" "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h printf "%s\n" "#define _POSIX_C_SOURCE 202405L" >>confdefs.h + + # Defining _POSIX_C_SOURCE and _XOPEN_SOURCE hides C23 library + # declarations on FreeBSD (e.g. sinpi() in math.h) when compiling + # with -std=c11. Defining _ISOC23_SOURCE makes them visible again. + +printf "%s\n" "#define _ISOC23_SOURCE 1" >>confdefs.h + fi # On HP-UX mbstate_t requires _INCLUDE__STDC_A1_SOURCE diff --git a/configure.ac b/configure.ac index 5e98a4f91c8d5ed..5fcf406087cbe5e 100644 --- a/configure.ac +++ b/configure.ac @@ -935,6 +935,12 @@ then AC_DEFINE([_POSIX_C_SOURCE], [202405L], [Define to activate features from IEEE Std 1003.1-2024]) + + # Defining _POSIX_C_SOURCE and _XOPEN_SOURCE hides C23 library + # declarations on FreeBSD (e.g. sinpi() in math.h) when compiling + # with -std=c11. Defining _ISOC23_SOURCE makes them visible again. + AC_DEFINE([_ISOC23_SOURCE], [1], + [Define to activate ISO C23 library declarations]) fi # On HP-UX mbstate_t requires _INCLUDE__STDC_A1_SOURCE diff --git a/pyconfig.h.in b/pyconfig.h.in index e259eda7439761e..25c4842d25e8a67 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -2143,6 +2143,9 @@ /* Define to include mbstate_t for mbrtowc */ #undef _INCLUDE__STDC_A1_SOURCE +/* Define to activate ISO C23 library declarations */ +#undef _ISOC23_SOURCE + /* This must be defined on some systems to enable large file support. */ #undef _LARGEFILE_SOURCE