Explicitly convert environment variable to str to address #4136

This commit is contained in:
step21 2018-10-31 09:41:02 +01:00
parent 47490c79be
commit 0d26ad3661
2 changed files with 3 additions and 3 deletions

View File

@ -30,8 +30,8 @@ from borg import xattr
@pytest.fixture(autouse=True)
def clean_env(tmpdir_factory, monkeypatch):
# avoid that we access / modify the user's normal .config / .cache directory:
monkeypatch.setenv('XDG_CONFIG_HOME', tmpdir_factory.mktemp('xdg-config-home'))
monkeypatch.setenv('XDG_CACHE_HOME', tmpdir_factory.mktemp('xdg-cache-home'))
monkeypatch.setenv('XDG_CONFIG_HOME', str(tmpdir_factory.mktemp('xdg-config-home')))
monkeypatch.setenv('XDG_CACHE_HOME', str(tmpdir_factory.mktemp('xdg-cache-home')))
# also avoid to use anything from the outside environment:
keys = [key for key in os.environ if key.startswith('BORG_')]
for key in keys:

View File

@ -68,7 +68,7 @@ class TestKey:
@pytest.fixture
def keys_dir(self, request, monkeypatch, tmpdir):
monkeypatch.setenv('BORG_KEYS_DIR', tmpdir)
monkeypatch.setenv('BORG_KEYS_DIR', str(tmpdir))
return tmpdir
@pytest.fixture(params=(