Created on 2015-09-14 04:32 by zach.ware, last changed 2022-04-11 14:58 by admin. This issue is now closed.
======================================================================
FAIL: test_no_args_respects_force_flag (test.test_compileall.CommandLineTests)
----------------------------------------------------------------------
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:
---
(... truncated stdout ...)rror: [Errno 13] Permission denied: 'C:\\Program Files\\Python 3.5\\lib\\__pycache__\\sre_compile.cpython-35.pyc.978608563184'
Compiling 'C:\\Program Files\\Python 3.5\\lib\\sre_constants.py'...
<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 issue21264 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': Issue #25099: Skip relevant tests in test_compileall when an entry on https://hg.python.org/cpython/rev/34bbd537b3e6 New changeset 21f3a92e0c6d by Brett Cannon in branch 'default': Merge for issue #25099 https://hg.python.org/cpython/rev/21f3a92e0c6d
Thanks to Serhiy for all of the reviews!
Do you want to backport the fix to 3.4 (and 2.7?)? Issue21264 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': Issue #25099: Skip relevant tests in test_compileall when an entry on https://hg.python.org/cpython/rev/fc0a7aa7ae61
messages: + msg252663
messages: + msg252640
stage: needs patch -> patch review