Issue26935
Created on 2016-05-03 15:03 by xdegaye, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| test_output.txt | xdegaye, 2016-05-03 15:03 | test results | ||
| test_urandom_fd_reopened.patch | xdegaye, 2016-05-07 16:02 | review | ||
| test_urandom_fd_reopened_2.patch | xdegaye, 2016-11-03 10:43 | review | ||
| test_urandom_fd_reopened_3.patch | xdegaye, 2016-11-05 19:38 | review | ||
| Messages (10) | |||
|---|---|---|---|
| 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 "<stdin>", line 1, in <module> 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 msg265099 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 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:30 | admin | set | github: 71122 |
| 2016-11-16 07:37:17 | xdegaye | set | status: open -> closed dependencies: - android: add platform.android_ver() resolution: fixed stage: commit review -> resolved |
| 2016-11-16 07:07:09 | python-dev | set | nosy:
+ python-dev messages: + msg280920 |
| 2016-11-05 19:38:46 | xdegaye | set | files:
+ test_urandom_fd_reopened_3.patch messages: + msg280124 |
| 2016-11-03 10:43:39 | xdegaye | set | files:
+ test_urandom_fd_reopened_2.patch versions: + Python 3.7 messages: + msg279984 assignee: xdegaye |
| 2016-05-21 07:06:39 | xdegaye | link | issue26865 dependencies |
| 2016-05-10 14:47:34 | xdegaye | set | messages: + msg265249 |
| 2016-05-08 15:06:14 | yan12125 | set | nosy:
+ yan12125 messages: + msg265144 |
| 2016-05-08 11:05:21 | martin.panter | set | dependencies:
+ android: add platform.android_ver() messages: + msg265127 components: + Tests, - Library (Lib), Cross-Build |
| 2016-05-08 10:45:19 | xdegaye | set | messages: + msg265124 |
| 2016-05-07 22:52:37 | martin.panter | set | nosy:
+ martin.panter messages:
+ msg265099 |
| 2016-05-07 16:02:44 | xdegaye | set | files:
+ test_urandom_fd_reopened.patch keywords: + patch messages: + msg265074 |
| 2016-05-03 15:03:20 | xdegaye | create | |

