diff --git a/Misc/NEWS.d/next/Library/2026-07-21-20-34-05.gh-issue-154389.DlTiii.rst b/Misc/NEWS.d/next/Library/2026-07-21-20-34-05.gh-issue-154389.DlTiii.rst new file mode 100644 index 00000000000000..eb2e2edc2d720e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-07-21-20-34-05.gh-issue-154389.DlTiii.rst @@ -0,0 +1,3 @@ +Fix :func:`uuid.uuid1` on OpenBSD: +it returned a version 4 UUID, +because ``uuid_create()`` generates random UUIDs on this platform. diff --git a/configure b/configure index 717a2079124129..7be3c3ec7c94d9 100755 --- a/configure +++ b/configure @@ -14668,9 +14668,10 @@ then : fi -# gh-124228: While the libuuid library is available on NetBSD, it supports only UUID version 4. +# gh-124228: While the libuuid library is available on NetBSD and OpenBSD, +# it supports only UUID version 4. # This restriction inhibits the proper generation of time-based UUIDs. -if test "$ac_sys_system" = "NetBSD"; then +if test "$ac_sys_system" = "NetBSD" || test "$ac_sys_system" = "OpenBSD"; then have_uuid=missing printf "%s\n" "#define HAVE_UUID_H 0" >>confdefs.h diff --git a/configure.ac b/configure.ac index cac2f931c91aa1..92b0a3c8962559 100644 --- a/configure.ac +++ b/configure.ac @@ -3894,9 +3894,10 @@ AS_VAR_IF([ac_cv_have_uuid_generate_time_safe], [yes], [ AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [1]) ]) -# gh-124228: While the libuuid library is available on NetBSD, it supports only UUID version 4. +# gh-124228: While the libuuid library is available on NetBSD and OpenBSD, +# it supports only UUID version 4. # This restriction inhibits the proper generation of time-based UUIDs. -if test "$ac_sys_system" = "NetBSD"; then +if test "$ac_sys_system" = "NetBSD" || test "$ac_sys_system" = "OpenBSD"; then have_uuid=missing AC_DEFINE([HAVE_UUID_H], [0]) fi