[Distutils] distutils.util.get_platform() - Linux vs Windows

Ronald Oussoren ronaldoussoren at mac.com
Thu Aug 22 12:20:36 CEST 2013


On 20 Aug, 2013, at 18:00, samuel.ferencik at barclays.com wrote:

>> -----Original Message-----
>> From: Chris Barker - NOAA Federal [mailto:chris.barker at noaa.gov] 
>> Sent: Tuesday, August 20, 2013 5:47 PM
>> To: Ferencik, Samuel: Markets (PRG)
>> Cc: distutils-sig at python.org
>> Subject: Re: [Distutils] distutils.util.get_platform() - Linux vs Windows
>> 
>> On Mon, Aug 19, 2013 at 11:15 PM,  <samuel.ferencik at barclays.com> wrote:
>> 
>>> What does your 'uname -m' return?
>> 
>> x86_64
>> 
>>> Is it possible you're really running a 32-bit
>>> Python on a *32-bit* OS X kernel? [http://superuser.com/q/161195]
>> 
>> nope -- I am quite deliberately running a 32 bit Python on my 64 bit
>> OS (I have some custom code C++ I"m using that is not yet 64 bit
>> safe).
> 
> That's strange. I'm on Python 3.3.1, and it seems to me that get_platform()
> derives the value from uname for OS X, similar to Linux.
> 
>    (osname, host, release, version, machine) = os.uname()
>    ...
>    elif osname[:6] == "darwin":
>        import _osx_support, distutils.sysconfig
>        osname, release, machine = _osx_support.get_platform_osx(
>                                        distutils.sysconfig.get_config_vars(),
>                                        osname, release, machine)
>    return "%s-%s-%s" % (osname, release, machine)
> 
> so I would expect "uname -m" to be in line with get_plaform(). But maybe I'm
> misreading that... Also, I don't have access to the _osx_support source code.

_osx_support is a pure python module in the stdlib, the source is in the usual 
location.

The behavior on OSX is quite intentional and ensures that disutils binary archive
names correctly reflect the use of fat binaries and the minimal supported OSX release.

The only thing that might need change is the name of the supported architectures,
the wheel spec has a better way to indicate multiple executable architectures than
making up names for every set of architectures that we care to support, but to be
honest I haven't had time yet to fully ingest the spec and work out if is completely
useful for fat binaries on OSX.

> 
>> 
>>> return value is wrong on Linux and correct on
>>> Windows, right?
>> 
>> no -- I'm saying that it's right on Windows (and OS-X), but wrong on Linux.
> 
> I think you have misread my sentence, and we actually agree here.
> 
> What's the next action? Report a Python bug? (That's a cultural question; I'm
> new to Python.)

http://bugs.python.org/

Ronald


More information about the Distutils-SIG mailing list