Skip to content

Commit eaacbdf

Browse files
committed
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().
1 parent 06e347b commit eaacbdf

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Doc/library/platform.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,17 @@ macOS platform
234234
Entries which cannot be determined are set to ``''``. All tuple entries are
235235
strings.
236236

237+
.. note::
238+
239+
Where macOS has changed its versioning scheme, it reports the next
240+
logical version assuming the old scheme to applications built with any
241+
prior macOS SDK version unless a ``SYSTEM_VERSION_COMPAT=0`` environment
242+
variable is set, or the application is rebuilt with a matching SDK. On
243+
macOS >= 11.0, if Python is built with SDK < 11 then the ``release``
244+
field is ``'10.16'``. And on macOS >= 26, it's ``'16.0'`` unless Python
245+
was built with SDK >= 26.0.
246+
247+
237248
iOS platform
238249
------------
239250

0 commit comments

Comments
 (0)