Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- self = <_pytest.tmpdir.TempdirFactory object at 0x7f23a5fc6b00>
- def getbasetemp(self):
- """ return base temporary directory. """
- try:
- > return self._basetemp
- E AttributeError: 'TempdirFactory' object has no attribute '_basetemp'
- /usr/local/lib/python3.6/site-packages/_pytest/tmpdir.py:48: AttributeError
- During handling of the above exception, another exception occurred:
- self = <module 'py.error'>, func = <function rmtree at 0x7f23abf71378>, args = ('/src/buildstream/tmp',)
- kwargs = {'ignore_errors': False}, __tracebackhide__ = False, cls = <class 'py.error.EISDIR'>
- value = IsADirectoryError(21, 'Is a directory'), tb = <traceback object at 0x7f238c2405c8>, errno = 21
- def checked_call(self, func, *args, **kwargs):
- """ call a function and raise an errno-exception if applicable. """
- __tracebackhide__ = True
- try:
- > return func(*args, **kwargs)
- /usr/local/lib/python3.6/site-packages/py/_error.py:66:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- path = '/src/buildstream/tmp', ignore_errors = False
- onerror = <function rmtree.<locals>.onerror at 0x7f238ca447b8>
- def rmtree(path, ignore_errors=False, onerror=None):
- """Recursively delete a directory tree.
- If ignore_errors is set, errors are ignored; otherwise, if onerror
- is set, it is called to handle the error with arguments (func,
- path, exc_info) where func is platform and implementation dependent;
- path is the argument to that function that caused it to fail; and
- exc_info is a tuple returned by sys.exc_info(). If ignore_errors
- is false and onerror is None, an exception is raised.
- """
- if ignore_errors:
- def onerror(*args):
- pass
- elif onerror is None:
- def onerror(*args):
- raise
- if _use_fd_functions:
- # While the unsafe rmtree works fine on bytes, the fd based does not.
- if isinstance(path, bytes):
- path = os.fsdecode(path)
- # Note: To guard against symlink races, we use the standard
- # lstat()/open()/fstat() trick.
- try:
- orig_st = os.lstat(path)
- except Exception:
- onerror(os.lstat, path, sys.exc_info())
- return
- try:
- fd = os.open(path, os.O_RDONLY)
- except Exception:
- onerror(os.lstat, path, sys.exc_info())
- return
- try:
- if os.path.samestat(orig_st, os.fstat(fd)):
- > _rmtree_safe_fd(fd, path, onerror)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement