-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
gh-135675: Document 10.16 vs 11.0 / 16.0 vs 26.0 behavior of platform.mac_ver() #136339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ython#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().
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable is set. On macOS 11.0, the ``release`` field if Python is built | |
variable is set, or the application is rebuild with a matching SDK. 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion also allows simplifying the version detail.
Possibly:
On macOS 11 or later the compatibility version reported in the
release
field is10.16
, on macOS 26 or later it is16.0
.
This still isn't 100% correct. AFAIK a binary compiled with a 10.15 SDK will report the system version as 10.16 even on macOS 26.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
FWIW: I'll leave this to @ronaldoussoren to review and decide. I'm not a Mac expert. |
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 ofplatform.mac_ver()
.Closes #135675.
platform.mac_ver()
returns macOS version of 16.0 instead of 26.0 on Tahoe #135675📚 Documentation preview 📚: https://cpython-previews--136339.org.readthedocs.build/