This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_zipfile: requires write access to test and email.test
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: alanmcintyre, berker.peksag, doko, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2013-04-16 10:53 by doko, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue17753.patch serhiy.storchaka, 2015-02-05 19:27 review
Messages (7)
msg187069 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2013-04-16 10:53
test_zipfile requires write access to the installed location, when trying to byte-compile files.

======================================================================
ERROR: test_write_pyfile (test.test_zipfile.PyZipFileTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.3/test/test_zipfile.py", line 876, in test_write_pyfile
    zipfp.writepy(fn)
  File "/usr/lib/python3.3/zipfile.py", line 1622, in writepy
    fname, arcname = self._get_codename(pathname[0:-3], basename)
  File "/usr/lib/python3.3/zipfile.py", line 1674, in _get_codename
    if _compile(file_py):
  File "/usr/lib/python3.3/zipfile.py", line 1639, in _compile
    py_compile.compile(file, doraise=True, optimize=optimize)
  File "/usr/lib/python3.3/py_compile.py", line 141, in compile
    with open(cfile, 'wb') as fc:
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.3/test/__pycache__/test_zipfile.cpython-33.pyc'

======================================================================
ERROR: test_write_with_optimization (test.test_zipfile.PyZipFileTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.3/test/test_zipfile.py", line 920, in test_write_with_optimization
    zipfp.writepy(packagedir)
  File "/usr/lib/python3.3/zipfile.py", line 1585, in writepy
    fname, arcname = self._get_codename(initname[0:-3], basename)
  File "/usr/lib/python3.3/zipfile.py", line 1689, in _get_codename
    if not _compile(file_py, optimize=self._optimize):
  File "/usr/lib/python3.3/zipfile.py", line 1639, in _compile
    py_compile.compile(file, doraise=True, optimize=optimize)
  File "/usr/lib/python3.3/py_compile.py", line 141, in compile
    with open(cfile, 'wb') as fc:
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.3/email/__pycache__/__init__.cpython-33.pyo'
msg235447 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-02-05 19:27
Here is a patch which skips tests if there are no write access to the installed location.
msg235976 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-02-14 17:11
LGTM.
msg235993 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-02-14 21:18
New changeset 6ad5909319e0 by Serhiy Storchaka in branch '3.4':
Issue #17753: Skip test_zipfile tests which require write access to test
https://hg.python.org/cpython/rev/6ad5909319e0

New changeset 174f24d33bfe by Serhiy Storchaka in branch 'default':
Issue #17753: Skip test_zipfile tests which require write access to test
https://hg.python.org/cpython/rev/174f24d33bfe

New changeset dfe75713f152 by Serhiy Storchaka in branch '2.7':
Issue #17753: Skip test_zipfile tests which require write access to test
https://hg.python.org/cpython/rev/dfe75713f152
msg236084 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-02-16 01:30
Buildbots are not happy:

======================================================================
ERROR: test_write_filtered_python_package (test.test_zipfile.PyZipFileTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_zipfile.py", line 733, in test_write_filtered_python_package
    self.requiresWriteAccess(packagedir)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_zipfile.py", line 683, in requiresWriteAccess
    if not os.access(path, os.W_OK, effective_ids=True):
NotImplementedError: access: effective_ids unavailable on this platform

http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/9269/steps/test/logs/stdio
msg236086 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-02-16 02:36
New changeset 59716f28ed30 by Berker Peksag in branch '3.4':
Issue #17753: effective_ids unavailable on Windows.
https://hg.python.org/cpython/rev/59716f28ed30

New changeset 964753cf09de by Berker Peksag in branch 'default':
Issue #17753: effective_ids unavailable on Windows.
https://hg.python.org/cpython/rev/964753cf09de
msg236087 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-02-16 05:42
Thanks Berker.
History
Date User Action Args
2022-04-11 14:57:44adminsetgithub: 61953
2015-02-16 05:42:58serhiy.storchakasetstatus: open -> closed
2015-02-16 05:42:26serhiy.storchakasetmessages: + msg236087
2015-02-16 02:36:15python-devsetmessages: + msg236086
2015-02-16 01:30:12berker.peksagsetstatus: closed -> open

messages: + msg236084
2015-02-14 23:00:29serhiy.storchakasetstatus: open -> closed
assignee: serhiy.storchaka
resolution: fixed
stage: commit review -> resolved
2015-02-14 21:18:00python-devsetnosy: + python-dev
messages: + msg235993
2015-02-14 17:11:05berker.peksagsetnosy: + berker.peksag

messages: + msg235976
stage: patch review -> commit review
2015-02-05 19:27:01serhiy.storchakasetfiles: + issue17753.patch
versions: + Python 2.7
messages: + msg235447

keywords: + patch
stage: needs patch -> patch review
2014-11-18 17:55:46serhiy.storchakalinkissue21266 superseder
2014-10-01 21:14:55BreamoreBoysetnosy: + alanmcintyre, serhiy.storchaka

type: behavior
versions: + Python 3.5, - Python 3.3
2013-04-16 10:54:13dokolinkissue17750 dependencies
2013-04-16 10:53:57dokocreate