From 34ee2af6b3397634bd155c4069a43226a4f55ad3 Mon Sep 17 00:00:00 2001 From: step21 Date: Wed, 31 Oct 2018 09:41:02 +0100 Subject: [PATCH 1/4] 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 @@ 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: diff --git a/src/borg/testsuite/key.py b/src/borg/testsuite/key.py index 6a7a6c8d7..bb6b7ce35 100644 --- a/src/borg/testsuite/key.py +++ b/src/borg/testsuite/key.py @@ -67,7 +67,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=( From 85fa5e67f38672021635b563711dd7db34792071 Mon Sep 17 00:00:00 2001 From: step21 Date: Wed, 31 Oct 2018 13:57:08 +0100 Subject: [PATCH 2/4] Fixed link to cachedir spec in docs to address #4140 --- src/borg/archiver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/borg/archiver.py b/src/borg/archiver.py index 279194c1b..62b9b82b2 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -2674,7 +2674,7 @@ class Archiver: if tag_files: add_option('--exclude-caches', dest='exclude_caches', action='store_true', help='exclude directories that contain a CACHEDIR.TAG file ' - '(http://www.brynosaurus.com/cachedir/spec.html)') + '(http://www.bford.info/cachedir/spec.html)') add_option('--exclude-if-present', metavar='NAME', dest='exclude_if_present', action='append', type=str, help='exclude directories that are tagged by containing a filesystem object with ' From 2a3b534a6125053b0c7f2f1ab87e4dea74f389be Mon Sep 17 00:00:00 2001 From: step21 Date: Fri, 2 Nov 2018 00:33:19 +0100 Subject: [PATCH 3/4] Fixed link to cachedir spec in fs helper to address #4140 for 1.1-maint --- src/borg/helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/borg/helpers.py b/src/borg/helpers.py index aceaaf31a..bae8a0a70 100644 --- a/src/borg/helpers.py +++ b/src/borg/helpers.py @@ -516,7 +516,7 @@ def get_cache_dir(): fd.write(textwrap.dedent(""" # This file is a cache directory tag created by Borg. # For information about cache directory tags, see: - # http://www.brynosaurus.com/cachedir/ + # http://www.bford.info/cachedir/spec.html """).encode('ascii')) return cache_dir @@ -594,7 +594,7 @@ def dir_is_cachedir(path): """Determines whether the specified path is a cache directory (and therefore should potentially be excluded from the backup) according to the CACHEDIR.TAG protocol - (http://www.brynosaurus.com/cachedir/spec.html). + (http://www.bford.info/cachedir/spec.html). """ tag_path = os.path.join(path, CACHE_TAG_NAME) From 27eeef242a0442ecffc757dfd9ce779719deb5d6 Mon Sep 17 00:00:00 2001 From: step21 Date: Wed, 31 Oct 2018 07:56:16 +0100 Subject: [PATCH 4/4] Moving the flags of the compiled regex to the front to fix #4137 --- src/borg/shellpattern.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/borg/shellpattern.py b/src/borg/shellpattern.py index f71c3b9ce..899544975 100644 --- a/src/borg/shellpattern.py +++ b/src/borg/shellpattern.py @@ -62,4 +62,4 @@ def translate(pat, match_end=r"\Z"): else: res += re.escape(c) - return res + match_end + "(?ms)" + return "(?ms)" + res + match_end