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
Android: set sys.platform to android #76818
Comments
Currently, sys.platform and os.name are equal to 'linux' on Android. While Android uses the Linux kernel, the operating system is not a regular Linux. The libc (bionic) is very different than the regular glibc, the filesystem is organized very differently, etc. I propose to change sys.platform and os.name to 'android' when running on Android. |
Wait, os.name is 'posix' on Android. That's fine in fact. Only sys.platform should be updated. |
The idea was first discussed on python-dev: https://mail.python.org/pipermail/python-dev/2018-January/151874.html me: "It seems like sys.platform == 'android' would be more appropriate https://mail.python.org/pipermail/python-dev/2018-January/151887.html Brett Cannon: "I've had a similar thought myself.". |
A similar change was proposed by pmp-p on MicroPython: micropython/micropython#3564 His use case is to use ffi module on Android (see the PR for more information), currently ffi fails to locate libraries. |
I propose to leave MACHDEP unchanged: keep MACHDEP="linux". Can it create inconsistencies? Is it an issue in practice? My short term goal is to use sys.platform == 'android' has the reference test to check if we are running on Android. |
Sadly, I failed to find anyone to help me on this issue and I lost interest on supporting Android, so I just close the issue. Sorry. |
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: