From 1797037f89e064427e786f496330cbc581b39b49 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 5 Nov 2023 07:21:35 +1100 Subject: [PATCH] fix: Deprecated SafeConfigParser resolved (#1949) * fix: Update config.py #1948 * fix: Update appsdb.py #1948 --------- Co-authored-by: Laurent Raufaste --- mackup/appsdb.py | 2 +- mackup/config.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mackup/appsdb.py b/mackup/appsdb.py index 638ff40f4..3699cb1f0 100644 --- a/mackup/appsdb.py +++ b/mackup/appsdb.py @@ -26,7 +26,7 @@ def __init__(self): self.apps = dict() for config_file in ApplicationsDatabase.get_config_files(): - config = configparser.SafeConfigParser(allow_no_value=True) + config = configparser.ConfigParser(allow_no_value=True) # Needed to not lowercase the configuration_files in the ini files config.optionxform = str diff --git a/mackup/config.py b/mackup/config.py index 5fbbc9140..870a390d6 100644 --- a/mackup/config.py +++ b/mackup/config.py @@ -139,7 +139,7 @@ def _setup_parser(self, filename=None): filename (str) or None Returns: - SafeConfigParser + ConfigParser """ assert isinstance(filename, str) or filename is None @@ -147,7 +147,7 @@ def _setup_parser(self, filename=None): if not filename: filename = MACKUP_CONFIG_FILE - parser = configparser.SafeConfigParser( + parser = configparser.ConfigParser( allow_no_value=True, inline_comment_prefixes=(";", "#") ) parser.read(os.path.join(os.path.join(os.environ["HOME"], filename)))