Issue 25099: test_compileall fails when run by unprivileged user on installed Python (original) (raw)

Created on 2015-09-14 04:32 by zach.ware, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (15)

msg250614 - (view)

Author: Zachary Ware (zach.ware) * (Python committer)

Date: 2015-09-14 04:32

====================================================================== 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'...

No such problem on installed 3.4.3.

msg250633 - (view)

Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer)

Date: 2015-09-14 06:25

The failure can be reproduced on Linux if make the Lib/__pycache__/ directory non-writable.

msg250690 - (view)

Author: Steve Dower (steve.dower) * (Python committer)

Date: 2015-09-14 17:34

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.)

msg250694 - (view)

Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer)

Date: 2015-09-14 17:52

Existing reports about failure of different test. It may be the same issue or different but related issues.

msg250697 - (view)

Author: Brett Cannon (brett.cannon) * (Python committer)

Date: 2015-09-14 18:02

It sounds like some tests just need to have a decorator that blocks execution if the relevant pycache isn't writable.

msg251609 - (view)

Author: Brett Cannon (brett.cannon) * (Python committer)

Date: 2015-09-25 20:52

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.

msg251716 - (view)

Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer)

Date: 2015-09-27 18:59

Added comments on Rietveld.

msg252640 - (view)

Author: Brett Cannon (brett.cannon) * (Python committer)

Date: 2015-10-09 19:46

Here is a new patch that addresses Serhiy's comments.

msg252658 - (view)

Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer)

Date: 2015-10-09 21:08

Added new comments.

msg252663 - (view)

Author: Brett Cannon (brett.cannon) * (Python committer)

Date: 2015-10-09 21:19

I have addressed Serhiy's comments again.

msg252668 - (view)

Author: Roundup Robot (python-dev) (Python triager)

Date: 2015-10-09 22:10

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

msg252669 - (view)

Author: Brett Cannon (brett.cannon) * (Python committer)

Date: 2015-10-09 22:10

Thanks to Serhiy for all of the reviews!

msg252695 - (view)

Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer)

Date: 2015-10-10 07:04

Do you want to backport the fix to 3.4 (and 2.7?)? Issue21264 was reported for 3.4.

msg252723 - (view)

Author: Brett Cannon (brett.cannon) * (Python committer)

Date: 2015-10-10 16:08

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.

msg252732 - (view)

Author: Roundup Robot (python-dev) (Python triager)

Date: 2015-10-10 17:28

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

History

Date

User

Action

Args

2022-04-11 14:58:20

admin

set

github: 69286

2015-10-14 15:57:50

brett.cannon

set

status: open -> closed

2015-10-10 17:28:45

python-dev

set

messages: +

2015-10-10 16:08:46

brett.cannon

set

messages: +

2015-10-10 07:04:20

serhiy.storchaka

set

messages: +

2015-10-09 22:11:37

brett.cannon

link

issue21264 superseder

2015-10-09 22:10:39

brett.cannon

set

resolution: fixed
messages: +
stage: commit review -> resolved

2015-10-09 22:10:18

python-dev

set

nosy: + python-dev
messages: +

2015-10-09 21:19:56

brett.cannon

set

files: + issue25099.diff

messages: +

2015-10-09 21:08:34

serhiy.storchaka

set

messages: +

2015-10-09 19:46:51

brett.cannon

set

stage: patch review -> commit review

2015-10-09 19:46:43

brett.cannon

set

files: + issue25099.diff

messages: +

2015-09-27 18:59:14

serhiy.storchaka

set

messages: +

2015-09-25 20:52:46

brett.cannon

set

files: + issue25099.diff
keywords: + patch
messages: +

stage: needs patch -> patch review

2015-09-14 18:02:38

brett.cannon

set

messages: +

2015-09-14 17:52:47

serhiy.storchaka

set

messages: +

2015-09-14 17:34:13

steve.dower

set

messages: +

2015-09-14 17:14:51

brett.cannon

set

assignee: brett.cannon

2015-09-14 12🔞55

serhiy.storchaka

link

issue17750 dependencies

2015-09-14 06:30:08

serhiy.storchaka

set

nosy: + brett.cannon, georg.brandl, ncoghlan, benjamin.peterson, eric.snow

2015-09-14 06:25:41

serhiy.storchaka

set

nosy: + serhiy.storchaka
messages: +

2015-09-14 04:32:53

zach.ware

create