From 0d26ad366118812d1c56b2a9ca74356d1be978e3 Mon Sep 17 00:00:00 2001 From: step21 Date: Wed, 31 Oct 2018 09:41:02 +0100 Subject: [PATCH] Explicitly convert environment variable to str to address #4136 --- conftest.py | 4 ++-- src/borg/testsuite/key.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conftest.py b/conftest.py index cc428be1f..6fd596104 100644 --- a/conftest.py +++ b/conftest.py @@ -30,8 +30,8 @@ @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: diff --git a/src/borg/testsuite/key.py b/src/borg/testsuite/key.py index 1d6281056..b397435c2 100644 --- a/src/borg/testsuite/key.py +++ b/src/borg/testsuite/key.py @@ -68,7 +68,7 @@ class MockArgs: @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=(