From eaacbdfe04fe40564821a62e1aa5c3698e566551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Br=C3=A9nainn=20Woodsend?= Date: Sun, 6 Jul 2025 15:36:35 +0100 Subject: [PATCH] Document 10.16 vs 11.0 / 16.0 vs 26.0 behavior of platform.mac_ver() (#135675) The macOS version reported in /System/Library/CoreServices/SystemVersion.plist can vary depending on what version of the macOS SDK Python was built with. This discrepancy bleeds into the output of platform.mac_ver(). --- Doc/library/platform.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst index 06de152a742f28..c237018a828e0b 100644 --- a/Doc/library/platform.rst +++ b/Doc/library/platform.rst @@ -234,6 +234,17 @@ macOS platform Entries which cannot be determined are set to ``''``. All tuple entries are strings. + .. note:: + + Where macOS has changed its versioning scheme, it reports the next + logical version assuming the old scheme to applications built with any + prior macOS SDK version unless a ``SYSTEM_VERSION_COMPAT=0`` environment + variable is set, or the application is rebuilt with a matching SDK. On + macOS >= 11.0, if Python is built with SDK < 11 then the ``release`` + field is ``'10.16'``. And on macOS >= 26, it's ``'16.0'`` unless Python + was built with SDK >= 26.0. + + iOS platform ------------