Issue 19384: test_py_compile fails with OSError on FreeBSD for root user (original) (raw)

Created on 2013-10-25 05:33 by Claudiu.Popa, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_py_compile.patch Claudiu.Popa,2013-10-25 05:33 review
Messages (5)
msg201204 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2013-10-25 05:33
The actual error: ====================================================================== FAIL: test_exceptions_propagate (test.test_py_compile.PyCompileTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/tank/libs/cpython/Lib/test/test_py_compile.py", line 88, in test_exceptions_propagate py_compile.compile(self.source_path, self.pyc_path) AssertionError: OSError not raised ---------------------------------------------------------------------- Ran 7 tests in 0.007s FAILED (failures=1) test test_py_compile failed 1 test failed: test_py_compile os.chmod(self.directory, stat.S_IREAD) doesn't do what it is expected on FreeBSD for root user, the attached patch skips this test if the current user is root.
msg201211 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-10-25 06:45
The patch looks good to me. I'm curious, is a root user on FreeBSD allowed to create files inside a read-only directory?
msg201213 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2013-10-25 06:50
Yes, you can create files in a read-only directory if you are root, that's why os.chmod(directory, stat.S_IREAD is redundant there.
msg201216 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-10-25 07:22
New changeset e7b97822110f by Christian Heimes in branch 'default': Issue 19384: Fix test_py_compile for root user, patch by Claudiu Popa. http://hg.python.org/cpython/rev/e7b97822110f
msg201217 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-10-25 07:23
The test also fails for root user on Linux: $ sudo ./python Lib/test/test_py_compile.py .....F. ====================================================================== FAIL: test_exceptions_propagate (__main__.PyCompileTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_py_compile.py", line 92, in test_exceptions_propagate py_compile.compile(self.source_path, self.pyc_path) AssertionError: OSError not raised
History
Date User Action Args
2022-04-11 14:57:52 admin set github: 63583
2013-10-25 07:23:33 christian.heimes set status: open -> closedresolution: fixedmessages: + stage: patch review -> resolved
2013-10-25 07:22:23 python-dev set nosy: + python-devmessages: +
2013-10-25 06:50:04 Claudiu.Popa set messages: +
2013-10-25 06:45:07 christian.heimes set nosy: + christian.heimesmessages: + type: behaviorstage: patch review
2013-10-25 05:33:48 Claudiu.Popa create