classification
Title: platform.system_alias(): add macOS support
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ronaldoussoren, vstinner
Priority: normal Keywords: patch

Created on 2018-12-17 09:31 by vstinner, last changed 2018-12-18 18:51 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11187 closed vstinner, 2018-12-17 09:35
PR 11207 merged vstinner, 2018-12-18 10:52
Messages (6)
msg331960 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-12-17 09:31
platform.system_alias() documentation:

   Returns ``(system, release, version)`` aliased to common marketing names used
   for some systems.  It also does some reordering of the information in some cases
   where it would otherwise cause confusion.

IMHO "macOS" and macOS release are more appropriate than darwin and darwin release for platform.system_alias().

I propose to make a similar change in system_alias() than the platform.mac_ver() change made in bpo-35344.
msg331961 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-12-17 09:32
> than the platform.mac_ver() change made in bpo-35344

Oops, this issue changed platform.platform() (not platform.mac_ver()).
msg331964 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2018-12-17 10:09
The patch does not use the version information passed in to calculate the marketing version. That's a problem when passing in low-level information from a system running a different version of macOS (for example passing in the low-level version information from a macOS 10.8 system while the script is running on a macOS 10.14 system).
msg331966 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-12-17 10:19
> The patch does not use the version information passed in to calculate the marketing version. That's a problem when passing in low-level information from a system running a different version of macOS (for example passing in the low-level version information from a macOS 10.8 system while the script is running on a macOS 10.14 system).

Right. The function has a weird API. Maybe the function shouldn't be fixed in this case. If we don't fix it, I would like to at least document why the function doesn't replace Darwin with macOS.
msg332047 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-12-18 10:54
Ronald Oussoren:
> The patch does not use the version information passed in to calculate the marketing version. That's a problem when passing in low-level information from a system running a different version of macOS (for example passing in the low-level version information from a macOS 10.8 system while the script is running on a macOS 10.14 system).

I abandonned my PR 11187 and I wrote PR 11207 to add a comment explaining why Darwin is not replaced with macOS.

Well, use platform.platform() or platform.mac_ver() to get the macOS version ;-)
msg332076 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-12-18 18:51
New changeset 60875db2f67815d7d181c552bfac59e8c97619e3 by Victor Stinner in branch 'master':
bpo-35516: platform.system_alias() don't replace Darwin (GH-11207)
https://github.com/python/cpython/commit/60875db2f67815d7d181c552bfac59e8c97619e3
History
Date User Action Args
2018-12-18 18:51:54vstinnersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-12-18 18:51:41vstinnersetmessages: + msg332076
2018-12-18 10:54:37vstinnersetmessages: + msg332047
2018-12-18 10:52:38vstinnersetpull_requests: + pull_request10444
2018-12-17 10:19:42vstinnersetmessages: + msg331966
2018-12-17 10:09:06ronaldoussorensetnosy: + ronaldoussoren
messages: + msg331964
2018-12-17 09:35:43vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request10425
2018-12-17 09:32:55vstinnersetmessages: + msg331961
2018-12-17 09:31:27vstinnercreate