diff --git a/NEWS b/NEWS index bd76c1be..0ca65473 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +1.9.12.dev0 + * #1005: Fix the credential hooks to avoid using Python 3.12+ string features. Now borgmatic will + work with Python 3.9, 3.10, and 3.11 again. + 1.9.11 * #795: Add credential loading from file, KeePassXC, and Docker/Podman secrets. See the documentation for more information: diff --git a/borgmatic/hooks/credential/container.py b/borgmatic/hooks/credential/container.py index 5b41409b..a38e6d35 100644 --- a/borgmatic/hooks/credential/container.py +++ b/borgmatic/hooks/credential/container.py @@ -21,7 +21,9 @@ def load_credential(hook_config, config, credential_parameters): try: (secret_name,) = credential_parameters except ValueError: - raise ValueError(f'Cannot load invalid secret name: "{' '.join(credential_parameters)}"') + name = ' '.join(credential_parameters) + + raise ValueError(f'Cannot load invalid secret name: "{name}"') if not SECRET_NAME_PATTERN.match(secret_name): raise ValueError(f'Cannot load invalid secret name: "{secret_name}"') diff --git a/borgmatic/hooks/credential/file.py b/borgmatic/hooks/credential/file.py index 387b31b2..06854703 100644 --- a/borgmatic/hooks/credential/file.py +++ b/borgmatic/hooks/credential/file.py @@ -15,7 +15,9 @@ def load_credential(hook_config, config, credential_parameters): try: (credential_path,) = credential_parameters except ValueError: - raise ValueError(f'Cannot load invalid credential: "{' '.join(credential_parameters)}"') + name = ' '.join(credential_parameters) + + raise ValueError(f'Cannot load invalid credential: "{name}"') try: with open( diff --git a/borgmatic/hooks/credential/systemd.py b/borgmatic/hooks/credential/systemd.py index 085d9044..1de245a3 100644 --- a/borgmatic/hooks/credential/systemd.py +++ b/borgmatic/hooks/credential/systemd.py @@ -20,9 +20,9 @@ def load_credential(hook_config, config, credential_parameters): try: (credential_name,) = credential_parameters except ValueError: - raise ValueError( - f'Cannot load invalid credential name: "{' '.join(credential_parameters)}"' - ) + name = ' '.join(credential_parameters) + + raise ValueError(f'Cannot load invalid credential name: "{name}"') credentials_directory = os.environ.get('CREDENTIALS_DIRECTORY') diff --git a/pyproject.toml b/pyproject.toml index 61445bf0..d07f286a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "borgmatic" -version = "1.9.11" +version = "1.9.12.dev0" authors = [ { name="Dan Helfman", email="witten@torsion.org" }, ]