-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
test_compileall fails when run by unprivileged user on installed Python #69286
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
Comments
====================================================================== Traceback (most recent call last):
File "C:\Program Files\Python 3.5\lib\test\test_compileall.py", line 229, in test_no_args_respects_force_flag
self.assertRunOK('-f', PYTHONPATH=self.directory)
File "C:\Program Files\Python 3.5\lib\test\test_compileall.py", line 179, in assertRunOK
*self._get_run_args(args), **env_vars)
File "C:\Program Files\Python 3.5\lib\test\support\script_helper.py", line 135, in assert_python_ok
return _assert_python(True, *args, **env_vars)
File "C:\Program Files\Python 3.5\lib\test\support\script_helper.py", line 121, in _assert_python
err))
AssertionError: Process return code is 1
command line: ['C:\\Program Files\\Python 3.5\\python.exe', '-X', 'faulthandler', '-S', '-m', 'compileall', '-f'] stdout: <output continues with many more lines like the above two> No such problem on installed 3.4.3. |
The failure can be reproduced on Linux if make the Lib/__pycache__/ directory non-writable. |
IIRC there's an existing issue for this. (Or it may have just been mentioned in a "things that don't work when you're not root" list on an issue.) |
Existing bpo-21264 reports about failure of different test. It may be the same issue or different but related issues. |
It sounds like some tests just need to have a decorator that blocks execution if the relevant __pycache__ isn't writable. |
Here is a patch that should work. Can someone who has had the problem test it? It works in my limited testing but I want to make sure this solves it before I commit it. |
Added comments on Rietveld. |
Here is a new patch that addresses Serhiy's comments. |
Added new comments. |
I have addressed Serhiy's comments again. |
New changeset 34bbd537b3e6 by Brett Cannon in branch '3.5': New changeset 21f3a92e0c6d by Brett Cannon in branch 'default': |
Thanks to Serhiy for all of the reviews! |
Do you want to backport the fix to 3.4 (and 2.7?)? bpo-21264 was reported for 3.4. |
I feel I have already spent way too much time on this issue, but if you want to backport even further then feel free to. |
New changeset fc0a7aa7ae61 by Brett Cannon in branch '3.4': |
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: