[issue26855] android: add platform.android_ver()

2019-12-10 Thread Xavier de Gaye
Change by Xavier de Gaye : -- nosy: -xdegaye ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26855] android: add platform.android_ver()

2018-02-02 Thread pmpp
Change by pmpp : -- nosy: +pmpp ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue26855] android: add platform.android_ver()

2017-12-11 Thread STINNER Victor
STINNER Victor added the comment: > Yes, and fall back to spawning getprop if that fails. I suggest to start simple. Parsing a text file is simple, spawning a subprocess can have annoying side effects :-( -- ___ Python

[issue26855] android: add platform.android_ver()

2017-12-05 Thread Xavier de Gaye
Xavier de Gaye added the comment: Yes, and fall back to spawning getprop if that fails. In the following link Robin Gawenda is reporting that /system/build.prop is world readable on all the devices he checked:

[issue26855] android: add platform.android_ver()

2017-12-05 Thread STINNER Victor
STINNER Victor added the comment: "-rw-r--r-- 1 root root 2083 2017-07-12 22:01 /system/build.prop" so anyone can *read* the file. Maybe we can write a cheap parser for it, instead of spawning a subprocess or relying on a private function which may be removed in the

[issue26855] android: add platform.android_ver()

2017-12-05 Thread Xavier de Gaye
Xavier de Gaye added the comment: I cannot find a reference to the "build.prop" file in the Android documentation but google answers at the question ' what is "build.prop"': The “build.prop” file is a system file that exists on every Android device. The file contains

[issue26855] android: add platform.android_ver()

2017-12-05 Thread STINNER Victor
STINNER Victor added the comment: Chromium still uses the private __system_property_get() function: https://chromium.googlesource.com/chromium/+/trunk/base/sys_info_android.cc I would prefer a C function call rather than spawning a subprocess, just to get a value.

[issue26855] android: add platform.android_ver()

2017-02-03 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- assignee: xdegaye -> ___ Python tracker ___ ___

[issue26855] android: add platform.android_ver()

2016-11-06 Thread Xavier de Gaye
Xavier de Gaye added the comment: ANDROID_API_LEVEL can only be used in the Python test suite and platform.android_ver() must be used in the standard library. The reason why ANDROID_API_LEVEL can be used in the tests instead of using the runtime API level is that the Python test suite purpose

[issue26855] android: add platform.android_ver()

2016-11-06 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: I see Xavier de Gaye uses sysconfig.get_config_var('ANDROID_API_LEVEL') is various patches. That's OK if the build-time target API level of CPython matches runtime Android API level. Does CPython force API level matching? If so this issue is no longer

[issue26855] android: add platform.android_ver()

2016-06-05 Thread Xavier de Gaye
Xavier de Gaye added the comment: Agreed, and it is not part of the versioning scheme either. -- ___ Python tracker ___

[issue26855] android: add platform.android_ver()

2016-06-05 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: I guess ro.kernel.qemu is not generic enough to be an item in android_ver(). In tests you can simply use _android_getprop() -- ___ Python tracker

[issue26855] android: add platform.android_ver()

2016-06-05 Thread Xavier de Gaye
Xavier de Gaye added the comment: The ro.kernel.qemu property is set to 1 on an Android emulator and 0 otherwise. I think it should be added to the list. On some threading tests where the switch interval is set to one microsecond, it is necessary to set the switch interval to a higher value

[issue26855] android: add platform.android_ver()

2016-05-11 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: Version 3. Still using a try-catch clause to enclose the subprocess call, as _syscmd_ver does the same thing. -- Added file: http://bugs.python.org/file42813/android_ver.patch ___ Python tracker

[issue26855] android: add platform.android_ver()

2016-05-11 Thread Xavier de Gaye
Xavier de Gaye added the comment: IMHO returning an integer for the sdk field would be better. The patch could use shutil.which() to avoid subprocess calls when getprop is not available. It would be better to use a 'try/except ValueError' clause instead of isdigit(). The OSError and

[issue26855] android: add platform.android_ver()

2016-05-08 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: Android framework provides an SDK_INT field [1], which parses the value of `ro.build.version.sdk` and defaults to 0 if failed [2]. Should android_ver() return an integer for the `sdk` field, too? It simplifies the usage in #26935 and similar ones. [1]

[issue26855] android: add platform.android_ver()

2016-05-04 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: Version 2 attached. Removed ro.build.version.full. -- Added file: http://bugs.python.org/file42723/android_ver.patch ___ Python tracker

[issue26855] android: add platform.android_ver()

2016-05-04 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 04.05.2016 21:47, Chi Hsuan Yen wrote: > 1. Should Android 4.1 supported? If not pass_fds and logics for deriving it > can be removed. According to http://www.droid-life.com/tag/distribution/ the Jelly Bean versions (4.1, 4.2 and 4.3) still have a

[issue26855] android: add platform.android_ver()

2016-05-04 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: Several questions on implementation: 1. Should Android 4.1 supported? If not pass_fds and logics for deriving it can be removed. 2. I can't find ro.build.version.full on any device/emulator I have access to. Maybe it should be removed due to low popularity?

[issue26855] android: add platform.android_ver()

2016-05-03 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- title: add platform.android_ver() for android -> android: add platform.android_ver() ___ Python tracker