msg264736 - (view) |
Author: Xavier de Gaye (xdegaye) *  |
Date: 2016-05-03 15:03 |
One test of test_os fails on an android emulator running an x86 system image at API level 21. See the attached test_output.txt file. |
|
|
msg265074 - (view) |
Author: Xavier de Gaye (xdegaye) *  |
Date: 2016-05-07 16:02 |
On android dup2() returns with an error when both fds are the same: root@generic_x86:/data/local/tmp # python Python 3.6.0a0 (default:811ccdee6f87+, May 7 2016, 12:44:06) [GCC 4.9 20140827 (prerelease)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.dup2(1, 1) Traceback (most recent call last): File "", line 1, in OSError: [Errno 22] Invalid argument The attached patch fixes this in test_urandom_fd_reopened. |
|
|
msg265099 - (view) |
Author: Martin Panter (martin.panter) *  |
Date: 2016-05-07 22:52 |
I think this is an Android bug. See specification <http://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>, fix <https://android.googlesource.com/platform/bionic/+/be52e658171edf6651895c40d1563289bafa52f7%5E!/>. If the change is to go into Python, it would be good to include a comment admitting it is an Android workaround, rather than a general deficiency. |
|
|
msg265124 - (view) |
Author: Xavier de Gaye (xdegaye) *  |
Date: 2016-05-08 10:45 |
Since this seems to be fixed in a version of android that is more recent that API 21, maybe use the value of 'sdk.release' when platform.android_ver() is available after issue #26855 is fixed, with for example, if this is fixed at API 23: sdk_release = platform.android_ver()[1] if new_fd != fd or not sdk_release or sdk_release >= 23: |
|
|
msg265127 - (view) |
Author: Martin Panter (martin.panter) *  |
Date: 2016-05-08 11:05 |
Yes something like that should do the trick |
|
|
msg265144 - (view) |
Author: (yan12125) * |
Date: 2016-05-08 15:06 |
My implementation at #26855 returns a tuple of strings like other funcitons, including java_ver() and mac_ver(). Maybe it requires a change. |
|
|
msg265249 - (view) |
Author: Xavier de Gaye (xdegaye) *  |
Date: 2016-05-10 14:47 |
This is fixed at API 23 (Android 6.0) and test_os runs on an android-23-x86 emulator without failures. |
|
|
msg279984 - (view) |
Author: Xavier de Gaye (xdegaye) *  |
Date: 2016-11-03 10:43 |
This new patch takes into account Martin comment in and fixes a call to getpwall() as Android does not have getpwall(). |
|
|
msg280124 - (view) |
Author: Xavier de Gaye (xdegaye) *  |
Date: 2016-11-05 19:38 |
New patch. Thanks for the review Martin! |
|
|
msg280920 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-11-16 07:07 |
New changeset 80e4cb5888f3 by Xavier de Gaye in branch '3.6': Issue #26935: Fix broken Android dup2() in test_os https://hg.python.org/cpython/rev/80e4cb5888f3 New changeset da59b7084dbe by Xavier de Gaye in branch 'default': Issue #26935: Merge 3.6 https://hg.python.org/cpython/rev/da59b7084dbe |
|
|