From 6ae91b024ea974383112302f7ac78ea7d68b390e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Thu, 23 Jan 2025 12:34:41 +0100 Subject: [PATCH] Use `platformdirs` to find user configuration files The previous library we were using for this (`appdirs`) is dead upstream and not supported anymore in debian testing. Fixes #1058 --- dangerzone/util.py | 7 +++++-- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dangerzone/util.py b/dangerzone/util.py index a5063a0..bcad701 100644 --- a/dangerzone/util.py +++ b/dangerzone/util.py @@ -5,11 +5,14 @@ import sys import traceback import unicodedata -import appdirs +try: + import platformdirs +except ImportError: + import appdirs as platformdirs def get_config_dir() -> str: - return appdirs.user_config_dir("dangerzone") + return platformdirs.user_config_dir("dangerzone") def get_resource_path(filename: str) -> str: diff --git a/pyproject.toml b/pyproject.toml index d5ceb6e..d021422 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ include = [ [tool.poetry.dependencies] python = ">=3.9,<3.13" click = "*" -appdirs = "*" +platformdirs = "*" PySide6 = "^6.7.1" PyMuPDF = "^1.23.3" # The version in Fedora 39 colorama = "*"