From d1c0c257bdc2cc5212824316fa0ad391427782a6 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst index 06de152a742f28..2ea4ee7d31ca9f 100644 --- a/Doc/library/platform.rst +++ b/Doc/library/platform.rst @@ -234,6 +234,16 @@ 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. On macOS 11.0, the ``release`` field if Python is built + with SDK < 11 is ``'10.16'`` and on macOS 26.0, it's ``'16.0'`` unless + Python was built with SDK >= 26.0. + + iOS platform ------------