classification
Title: platform.system() should be "macosx" instead of "Darwin" on OSX
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.2, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Justin.Cappos, jackdied, lemburg, ronaldoussoren
Priority: normal Keywords:

Created on 2010-02-03 22:40 by ronaldoussoren, last changed 2010-02-22 22:35 by lemburg.

Messages (4)
msg98801 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2010-02-03 22:40
The output of platform.system() should IMO be "macosx" on OSX to ensure that platform.platform() is consistent with distutils.util.get_platform().

The same is true for sys.platform, although it is unclear how much code that would break.

There are two reasons for wanting these changes. First of all the values tend to end up at locations where less sophistated users might see them unless we're careful (tests for 'sys.platform' in scripts, platform names in distributions, ...) and 'darwin' is not obviously related to MacOSX unless you're already quite technical.   The other reason is slightly nit picking: "Darwin" is the name of the kernel and a stand-alone unix based on that, which MacOSX is the name of the entire system which includes much more beyond basic unix stuff.


BTW. I know why sys.platform is "darwin" on OSX, that doesn't mean I have to like it ;-)
msg99790 - (view) Author: Jack Diederich (jackdied) * (Python committer) Date: 2010-02-22 17:20
-1, my Ubuntu laptop says "linux2" and not "ubuntu." This would also be an incompatible change that would cause headaches with little benefit to balance it out.
msg99854 - (view) Author: Justin Cappos (Justin.Cappos) Date: 2010-02-22 22:15
Perhaps the right way to fix the problem without breaking code would be to propose a new function for platform which would return a 'newbie readable' string of the system type?
msg99860 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2010-02-22 22:35
platform.system() is a direct interface to platform.uname() which in return is an interface to the platform's uname() API, so the reasoning is much the same as for sys.platform on those platforms that do expose a uname() function (and command).

On Mac OS X, uname returns "Darwin".

What we can do, is add a new function parameter ''aliased'' (just like we have for platform.platform()) which then enables applying some aliasing to the returned uname() values.
History
Date User Action Args
2010-02-22 22:35:03lemburgsetmessages: + msg99860
2010-02-22 22:25:49brian.curtinsetnosy: + lemburg
2010-02-22 22:15:13Justin.Cappossetnosy: + Justin.Cappos
messages: + msg99854
2010-02-22 17:20:52jackdiedsetnosy: + jackdied
messages: + msg99790
2010-02-03 22:40:10ronaldoussorencreate