Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. ________________________ TestIntegration.test_filenames ________________________
  2. self = <tests.test_unit_integration.TestIntegration testMethod=test_filenames>
  3. def tearDown(self):
  4. > common.shared_teardown()
  5. tests/test_unit_integration.py:81:
  6. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  7. tests/common.py:74: in shared_teardown
  8. clean_root()
  9. tests/common.py:13: in clean_root
  10. shutil.rmtree(config.SECUREDROP_DATA_ROOT)
  11. /usr/lib/python2.7/shutil.py:245: in rmtree
  12. rmtree(fullname, ignore_errors, onerror)
  13. /usr/lib/python2.7/shutil.py:250: in rmtree
  14. onerror(os.remove, fullname, sys.exc_info())
  15. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  16. path = '/tmp/securedrop/keys', ignore_errors = False
  17. onerror = <function onerror at 0x45030c8>
  18. def rmtree(path, ignore_errors=False, onerror=None):
  19. """Recursively delete a directory tree.
  20.  
  21. If ignore_errors is set, errors are ignored; otherwise, if onerror
  22. is set, it is called to handle the error with arguments (func,
  23. path, exc_info) where func is os.listdir, os.remove, or os.rmdir;
  24. path is the argument to that function that caused it to fail; and
  25. exc_info is a tuple returned by sys.exc_info(). If ignore_errors
  26. is false and onerror is None, an exception is raised.
  27.  
  28. """
  29. if ignore_errors:
  30. def onerror(*args):
  31. pass
  32. elif onerror is None:
  33. def onerror(*args):
  34. raise
  35. try:
  36. if os.path.islink(path):
  37. # symlinks to directories are forbidden, see bug #1669
  38. raise OSError("Cannot call rmtree on a symbolic link")
  39. except OSError:
  40. onerror(os.path.islink, path, sys.exc_info())
  41. # can't continue even if onerror hook returns
  42. return
  43. names = []
  44. try:
  45. names = os.listdir(path)
  46. except os.error, err:
  47. onerror(os.listdir, path, sys.exc_info())
  48. for name in names:
  49. fullname = os.path.join(path, name)
  50. try:
  51. mode = os.lstat(fullname).st_mode
  52. except os.error:
  53. mode = 0
  54. if stat.S_ISDIR(mode):
  55. rmtree(fullname, ignore_errors, onerror)
  56. else:
  57. try:
  58. > os.remove(fullname)
  59. E OSError: [Errno 2] No such file or directory: '/tmp/securedrop/keys/pubring.gpg.lock'
  60. /usr/lib/python2.7/shutil.py:248: OSError
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement