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: test_os fails #71122
Comments
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. |
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. |
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. |
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 bpo-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: |
Yes something like that should do the trick |
My implementation at bpo-26855 returns a tuple of strings like other funcitons, including java_ver() and mac_ver(). Maybe it requires a change. |
This is fixed at API 23 (Android 6.0) and test_os runs on an android-23-x86 emulator without failures. |
This new patch takes into account Martin comment in msg265099 and fixes a call to getpwall() as Android does not have getpwall(). |
New patch. Thanks for the review Martin! |
New changeset 80e4cb5888f3 by Xavier de Gaye in branch '3.6': New changeset da59b7084dbe by Xavier de Gaye in branch 'default': |
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: