Extract of the error:
.tox/py27/local/lib/python2.7/site-packages/autocrypt/account.py:237: in del_identity
ident.delete()
.tox/py27/local/lib/python2.7/site-packages/autocrypt/account.py:382: in delete
shutil.rmtree(self.dir)
/usr/lib/python2.7/shutil.py:247: in rmtree
rmtree(fullname, ignore_errors, onerror)
/usr/lib/python2.7/shutil.py:252: in rmtree
onerror(os.remove, fullname, sys.exc_info())
[...]
os.remove(fullname)
E OSError: [Errno 2] No such file or directory: '/tmp/pytest-of-user/pytest-4/test6/a0/id/office/gpghome/S.gpg-agent.browser'
/usr/lib/python2.7/shutil.py:250: OSError
This might be caused because the socket is deleted before rmtree deletes the directory.
The solution for this could be to replace the line:
shutil.rmtree(self.dir)
with:
shutil.rmtree(self.dir, ignore_errors=True)
Extract of the error: .tox/py27/local/lib/python2.7/site-packages/autocrypt/account.py:237: in del_identity ident.delete() .tox/py27/local/lib/python2.7/site-packages/autocrypt/account.py:382: in delete shutil.rmtree(self.dir) /usr/lib/python2.7/shutil.py:247: in rmtree rmtree(fullname, ignore_errors, onerror) /usr/lib/python2.7/shutil.py:252: in rmtree onerror(os.remove, fullname, sys.exc_info()) [...]
This might be caused because the socket is deleted before rmtree deletes the directory. The solution for this could be to replace the line: shutil.rmtree(self.dir) with: shutil.rmtree(self.dir, ignore_errors=True)