-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
change sys.platform() to just "aix" for AIX #80769
Comments
This is something that probably shouts - boring - but back in 2012 it was a hot topic for linux2 and linux3. Maybe - as far back as 1996 (when AIX4 was new) "aix3" and "aix4" made sense. Whether that is true, or not - is pointless these days - for Python3. In the python code I have reviewed - for various reasons - I have never seen any code with "sys.platform() == "aixX" (where X is any of 5, 6, 7). There was a reference to "aix3" and "aix4" in setup.py (recently removed, and there is no replacement for aix5, aix6, or aix7 - not needed!) What I mostly see is sys.platform.startswith("aix"). The other form of the same test is sys.platform[:3] == 'aix' sys.platform is "build" related, e.g., potentially bound to libc issues. Even if this was the case (AIX offers since 2007 - official binary compatibility from old to new (when libc is dynamically linked, not static linked), was "unofficial" for aix3 and aix4). Yes, I am sure there are arguments along the line of "why change" since we have been updating it - always, and/or the documentation says so. linux2 had to stay, because there was known code that compared with linux2 (and that code was having problems when python was built on linux3 - hence the change to make sys.platform return linux2 for all Python3.2 and younger). FYI: in Cpython (master) there are no references to "aixX". All the references there are (in .py) are: michael@x071:[/data/prj/python/git/cpython-master]find . -name \*.py | xargs egrep "[\"']aix" I'll write the patch - if I recall it should be a one-liner in configure.ac, but I think some discussion (or blessing) first is appropriate. Maybe even review whether other platforms no longer rely on the X for the platform. Hoping this helps! |
I like the idea. Would you like to propose a patch? I suggest to only make such change in Python 3.8 and properly document it. |
On 10/04/2019 17:05, STINNER Victor wrote:
If I understand correctly, the change should be quite simple: diff --git a/configure.ac b/configure.ac case $MACHDEP in However, I am less familiar with (where) the appropriate documentation |
It would be nice to add a note to:
In the source code, there are the files: |
Was:
root@x064:[/data/prj/python/python3-3.8]./python
Python 3.8.0a3+ (heads/bpo-28009-2-dirty:2fb2bc81c3, Apr 11 2019, 07:09:55) [C] on aix6
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.platform
'aix6'
>>> import os
>>> os.uname()[3]
'7' ./python ../git/python3-3.8/Tools/scripts/patchcheck.py On system I built on:
root@x066:[/data/prj/python/python3-3.8]./python
Python 3.8.0a3+ (heads/bpo-36588-aix-platform-dirty:2021d40faa, Apr 11 2019, 15:16:05) [C] on aix
Type "help", "copyright", "credits" or "license" for more information.
>>> import os,sys
>>> sys.platform
'aix'
>>> os.uname()[3]
'6'
And on AIX7 system:
root@x064:[/data/prj/python/python3-3.8]./python
Python 3.8.0a3+ (heads/bpo-36588-aix-platform-dirty:2021d40faa, Apr 11 2019, 15:16:05) [C] on aix
Type "help", "copyright", "credits" or "license" for more information.
>>> import os,sys
>>> sys.platform
'aix'
>>> os.uname()[3]
'7' |
Do you want to work on a change to replace sys.platform.startswith("aix") to cleanup the stdlib and tests? Not sure if it's needed :-) It's up to you. |
On 12/04/2019 16:16, STINNER Victor wrote:
Sure. I'll do that. I shoul open an issue along the lines of "AIX: But, should I just continue standard practice (sys.platform), or would Michael |
Oh, now I'm confused :-) I checked the Python test suite: some tests use sys.platform == "linux" or sys.platform in ("linux", ...), some tests uses sys.platform.startswith("linux"). In case of doubt, I suggest to do nothing :-) Leave the code unchanged :-) |
On 12/04/2019 17:34, STINNER Victor wrote:
Agreed, in case of doubt - leave alone (never change a winning team). And, to make it a short reply - I'll get started, and we see where it Michael
|
On 12/04/2019 23:16, Michael Felt wrote:
I opened bpo-36624 (https://bugs.python.org/issue36624) - before I |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: