Advertisement
Guest User

Untitled

a guest
Mar 27th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. self = <_pytest.tmpdir.TempdirFactory object at 0x7f23a5fc6b00>
  2.  
  3. def getbasetemp(self):
  4. """ return base temporary directory. """
  5. try:
  6. > return self._basetemp
  7. E AttributeError: 'TempdirFactory' object has no attribute '_basetemp'
  8.  
  9. /usr/local/lib/python3.6/site-packages/_pytest/tmpdir.py:48: AttributeError
  10.  
  11. During handling of the above exception, another exception occurred:
  12.  
  13. self = <module 'py.error'>, func = <function rmtree at 0x7f23abf71378>, args = ('/src/buildstream/tmp',)
  14. kwargs = {'ignore_errors': False}, __tracebackhide__ = False, cls = <class 'py.error.EISDIR'>
  15. value = IsADirectoryError(21, 'Is a directory'), tb = <traceback object at 0x7f238c2405c8>, errno = 21
  16.  
  17. def checked_call(self, func, *args, **kwargs):
  18. """ call a function and raise an errno-exception if applicable. """
  19. __tracebackhide__ = True
  20. try:
  21. > return func(*args, **kwargs)
  22.  
  23. /usr/local/lib/python3.6/site-packages/py/_error.py:66:
  24. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  25.  
  26. path = '/src/buildstream/tmp', ignore_errors = False
  27. onerror = <function rmtree.<locals>.onerror at 0x7f238ca447b8>
  28.  
  29. def rmtree(path, ignore_errors=False, onerror=None):
  30. """Recursively delete a directory tree.
  31.  
  32. If ignore_errors is set, errors are ignored; otherwise, if onerror
  33. is set, it is called to handle the error with arguments (func,
  34. path, exc_info) where func is platform and implementation dependent;
  35. path is the argument to that function that caused it to fail; and
  36. exc_info is a tuple returned by sys.exc_info(). If ignore_errors
  37. is false and onerror is None, an exception is raised.
  38.  
  39. """
  40. if ignore_errors:
  41. def onerror(*args):
  42. pass
  43. elif onerror is None:
  44. def onerror(*args):
  45. raise
  46. if _use_fd_functions:
  47. # While the unsafe rmtree works fine on bytes, the fd based does not.
  48. if isinstance(path, bytes):
  49. path = os.fsdecode(path)
  50. # Note: To guard against symlink races, we use the standard
  51. # lstat()/open()/fstat() trick.
  52. try:
  53. orig_st = os.lstat(path)
  54. except Exception:
  55. onerror(os.lstat, path, sys.exc_info())
  56. return
  57. try:
  58. fd = os.open(path, os.O_RDONLY)
  59. except Exception:
  60. onerror(os.lstat, path, sys.exc_info())
  61. return
  62. try:
  63. if os.path.samestat(orig_st, os.fstat(fd)):
  64. > _rmtree_safe_fd(fd, path, onerror)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement