Message261050
while reading to learn...
FYI: AIX does not return even a hint of the underlying platform (assumption is probably 64-bit) - but the value of the interpreter is anyone's guess
root@x064:[/data/prj/aixtools/python/python-2.7.10]python
Python 2.7.10 (default, Mar 1 2016, 12:55:35) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.
>>> import distutils.util
>>> distutils.util.get_platform()
'aix-5.3'
>>> import os
>>> os.uname()
('AIX', 'x064', '3', '5', '00XXXXXXXXXX')
Going through the rest of the preceding messages:
a) platform.architecture() - seems accurate for AIX, is import so expensive that it is not preferred?
>>> import platform
>>> platform.architecture()
('32bit', '')
b) sys.maxsize < 2**16 is a good hint, but it is possible to have a 64-bit int with only 32-bit pointers - based on assumption!
>>> import os, sys
>>> sys.maxsize
2147483647
>>> 2**32
4294967296L
>>> 2**31
2147483648L
> If your wording is correct, and get_platform() really is used to determine "the
> python being used," then we could actually be improving things by fixing this.
> Currently, get_platform() doesn't tell you the bitness of the *python* being
> used, but the bitness of the *OS* being used (the two of which only differ on
> 32-on-64).
So, it seems get_platform() does not have a uniform result that could ever be parsed by internal or external modules. It is always dependent on something external to python (e.g., uname() output).
IMHO: determining and adding the python bitness, as MacOS has done (i.e., I assume it is either (32-bit) or (64-bit) at the end) is a move forward - and I would be willing to submit a couple of somethings so that that value could be determined - leave it to a committer to decide what makes best sense.
Of course, it is "sad" if it breaks existing things, but being non-uniform as it is worse (imho :smile:) |
|
Date |
User |
Action |
Args |
2016-03-01 13:59:27 | Michael.Felt | set | recipients:
+ Michael.Felt, jaraco, pitrou, tarek, jkloth, ned.deily, eric.araujo, Arfrever, Dima.Tisnek, sferencik, djones |
2016-03-01 13:59:27 | Michael.Felt | set | messageid: <1456840767.29.0.155223972588.issue18987@psf.upfronthosting.co.za> |
2016-03-01 13:59:27 | Michael.Felt | link | issue18987 messages |
2016-03-01 13:59:26 | Michael.Felt | create | |
|