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_os (non-root user on Android) #73366
Comments
====================================================================== [1633/2616] Traceback (most recent call last):
File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_os.py", line 1703, in test_link
self._test_link(self.file1, self.file2)
File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_os.py", line 1698, in _test_link
os.link(file1, file2)
PermissionError: [Errno 13] Permission denied: '@test_2295_tmp' -> '@test_2295_tmp2' ====================================================================== Traceback (most recent call last):
File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_os.py", line 1707, in test_link_bytes
bytes(self.file2, sys.getfilesystemencoding()))
File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_os.py", line 1698, in _test_link
os.link(file1, file2)
PermissionError: [Errno 13] Permission denied: b'@test_2295_tmp' -> b'@test_2295_tmp2' ====================================================================== Traceback (most recent call last):
File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_os.py", line 1717, in test_unicode_name
self._test_link(self.file1, self.file2)
File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_os.py", line 1698, in _test_link
os.link(file1, file2)
PermissionError: [Errno 13] Permission denied: '@test_2295_tmpñ' -> '@test_2295_tmpñ2' ====================================================================== Traceback (most recent call last):
File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_os.py", line 2795, in test_stty_match
size = subprocess.check_output(['stty', 'size']).decode().split()
File "/sdcard/org.bitbucket.pyona/lib/python3.7/subprocess.py", line 336, in check_output
**kwargs).stdout
File "/sdcard/org.bitbucket.pyona/lib/python3.7/subprocess.py", line 403, in run
with Popen(*popenargs, **kwargs) as process:
File "/sdcard/org.bitbucket.pyona/lib/python3.7/subprocess.py", line 707, in __init__
restore_signals, start_new_session)
File "/sdcard/org.bitbucket.pyona/lib/python3.7/subprocess.py", line 1323, in _execute_child
raise child_exception_type(errno_num, err_msg)
PermissionError: [Errno 13] Permission denied ====================================================================== Traceback (most recent call last):
File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_os.py", line 3150, in test_attributes
os.link(filename, os.path.join(self.path, "link_file.txt"))
PermissionError: [Errno 13] Permission denied: '/data/local/tmp/test_python_2295/@test_2295_tmp/file
.txt' -> '/data/local/tmp/test_python_2295/@test_2295_tmp/link_file.txt' Ran 238 tests in 4.675s FAILED (errors=5, skipped=40) |
Patch attached. |
Are you planning to use test.support.os_link() to fix other tests in near future? If test_os is the only user of the helper, I'd say let's keep it in Lib/test/test_os.py for now. test.support is already big enough and it would be better not to put every snippet in it :) If there are other tests that can benefit from using it, the patch looks good to me. |
I agree with that concern. support.os_link() is also used by a patch in bpo-29181, and I am planning to modify the changes made by bpo-28759 to also use it so that tests calling os.link() are skipped based on the fact that they raise PermissionError instead of based on the fact that they are being run by an Android non-root user as is currently the case. |
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: