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
skip tests that raise PermissionError in test_tarfile (non-root user on Android) #73367
Comments
====================================================================== [339/2616] Traceback (most recent call last):
File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_tarfile.py", line 1102, in test_link_siz
e
os.link(target, link)
PermissionError: [Errno 13] Permission denied: '/data/local/tmp/test_python_2295/@test_2295_tmp-tard
ir/link_target' -> '/data/local/tmp/test_python_2295/@test_2295_tmp-tardir/link' ====================================================================== Traceback (most recent call last):
File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_tarfile.py", line 1102, in test_link_siz
e
os.link(target, link)
PermissionError: [Errno 13] Permission denied: '/data/local/tmp/test_python_2295/@test_2295_tmp-tard
ir/link_target' -> '/data/local/tmp/test_python_2295/@test_2295_tmp-tardir/link' ====================================================================== Traceback (most recent call last):
File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_tarfile.py", line 1563, in setUp
os.link(self.foo, self.bar)
PermissionError: [Errno 13] Permission denied: '/data/local/tmp/test_python_2295/@test_2295_tmp-tard
ir/foo' -> '/data/local/tmp/test_python_2295/@test_2295_tmp-tardir/bar' ====================================================================== Traceback (most recent call last):
File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_tarfile.py", line 1563, in setUp
os.link(self.foo, self.bar)
PermissionError: [Errno 13] Permission denied: '/data/local/tmp/test_python_2295/@test_2295_tmp-tard
ir/foo' -> '/data/local/tmp/test_python_2295/@test_2295_tmp-tardir/bar' ====================================================================== Traceback (most recent call last):
File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_tarfile.py", line 1563, in setUp
os.link(self.foo, self.bar)
PermissionError: [Errno 13] Permission denied: '/data/local/tmp/test_python_2295/@test_2295_tmp-tard
ir/foo' -> '/data/local/tmp/test_python_2295/@test_2295_tmp-tardir/bar' ====================================================================== Traceback (most recent call last):
File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_tarfile.py", line 1102, in test_link_siz
e
os.link(target, link)
PermissionError: [Errno 13] Permission denied: '/data/local/tmp/test_python_2295/@test_2295_tmp-tard
ir/link_target' -> '/data/local/tmp/test_python_2295/@test_2295_tmp-tardir/link' Ran 426 tests in 17.296s FAILED (errors=6, skipped=80) |
Patch attached. |
Why os.link() is failed? If hard links are not supported on Android, shouldn't os.link be not implemented? tarfile try to make a copy of the referenced file instead of a link if a link can't be created. |
Android has a restrictive security model based on SELinux [1]. With the Android adb shell on the emulator at API level 24: $ >foo
$ ln foo bar
ln: cannot create hard link from 'foo' to 'bar': Permission denied
$ su
# ln foo bar
# ls -li foo bar
15688 -rw-rw-rw- 2 shell shell 0 2017-01-07 22:29 bar
15688 -rw-rw-rw- 2 shell shell 0 2017-01-07 22:29 foo Here is the Android commit message that does not grant hard link capabilities by default: |
New patch following Serhiy's suggestion in msg285008. |
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: