Skip to content

Permission denied with Python3.2 #112

Closed
@pytestbot

Description

@pytestbot

Originally reported by: BitBucket: andrewcooke, GitHub: andrewcooke


Hi,

I just tried to install and run pytest under python 3.2 and I see many errors like:

IOError: [Errno 13] Permission denied: '/usr/local/lib/python3.2/__pycache__/threading.cpython-32-PYTEST.pyc.14390'

I installed again with Python 2.7 to check, and that works fine:

: python2.7 -m py.test .
============================= test session starts ==============================
platform linux2 -- Python 2.7.2 -- pytest-2.2.1
collected 1086 items / 3 errors 

lepl/_example/args.py .
lepl/_example/columns.py .
lepl/_example/config.py .
lepl/_example/dynamic.py .
lepl/_example/error.py ..
lepl/_example/expression.py .
lepl/_example/expression2.py ^C

But the identical command with Python3.2 gives:

: python3.2 -m py.test .
============================= test session starts ==============================
platform linux2 -- Python 3.2.2 -- pytest-2.2.1
collected 0 items / 295 errors 

==================================== ERRORS ====================================
______________________ ERROR collecting lepl/__init__.py _______________________
lepl/__init__.py:113: in <module>
>   from lepl.contrib.matchers import SmartSeparator2
/usr/local/lib/python3.2/site-packages/pytest-2.2.1-py3.2.egg/_pytest/assertion/rewrite.py:157: in load_module
>           py.builtin.exec_(co, mod.__dict__)
lepl/contrib/matchers.py:41: in <module>
>   from lepl.matchers.derived import Optional
/usr/local/lib/python3.2/site-packages/pytest-2.2.1-py3.2.egg/_pytest/assertion/rewrite.py:157: in load_module
>           py.builtin.exec_(co, mod.__dict__)
lepl/matchers/derived.py:38: in <module>
>   from lepl.matchers.combine import And, DepthFirst, BreadthFirst, \
/usr/local/lib/python3.2/site-packages/pytest-2.2.1-py3.2.egg/_pytest/assertion/rewrite.py:157: in load_module
>           py.builtin.exec_(co, mod.__dict__)
lepl/matchers/combine.py:45: in <module>
>   from lepl.matchers.core import Literal
/usr/local/lib/python3.2/site-packages/pytest-2.2.1-py3.2.egg/_pytest/assertion/rewrite.py:157: in load_module
>           py.builtin.exec_(co, mod.__dict__)
lepl/matchers/core.py:36: in <module>
>   from lepl.stream.core import s_next, s_eq, s_empty, s_line
/usr/local/lib/python3.2/site-packages/pytest-2.2.1-py3.2.egg/_pytest/assertion/rewrite.py:157: in load_module
>           py.builtin.exec_(co, mod.__dict__)
lepl/stream/core.py:43: in <module>
>   from lepl.support.lib import fmt
/usr/local/lib/python3.2/site-packages/pytest-2.2.1-py3.2.egg/_pytest/assertion/rewrite.py:157: in load_module
>           py.builtin.exec_(co, mod.__dict__)
lepl/support/lib.py:33: in <module>
>   from logging import getLogger
/usr/local/lib/python3.2/logging/__init__.py:45: in <module>
>       import threading
/usr/local/lib/python3.2/site-packages/pytest-2.2.1-py3.2.egg/_pytest/assertion/rewrite.py:141: in find_module
>               _make_rewritten_pyc(state, fn_pypath, pyc, co)
/usr/local/lib/python3.2/site-packages/pytest-2.2.1-py3.2.egg/_pytest/assertion/rewrite.py:225: in _make_rewritten_pyc
>           if _write_pyc(co, fn, proc_pyc):
/usr/local/lib/python3.2/site-packages/pytest-2.2.1-py3.2.egg/_pytest/assertion/rewrite.py:170: in _write_pyc
>           fp = open(pyc, "wb")
E           IOError: [Errno 13] Permission denied: '/usr/local/lib/python3.2/__pycache__/threading.cpython-32-PYTEST.pyc.14692'
etc etc

This is particularly frustrating since I use pytest in Intellij Idea as a test runner - it's the only hing that seems to work (everything else wants file names with certain conventions that I haven't followed etc).


Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions