From f41db714a9aec0869186aa0a04c3f087b7751321 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Tue, 8 Feb 2022 16:14:06 +0530 Subject: [PATCH] Remove any quotes from str/path values in the config --- headphones/config.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/headphones/config.py b/headphones/config.py index 69fdff08..618ec97a 100644 --- a/headphones/config.py +++ b/headphones/config.py @@ -363,12 +363,12 @@ class Config(object): try: my_val = definition_type(self._config[section][ini_key]) - # ConfigParser interprets empty strings in the config + # ConfigParser interprets quotes in the config # literally, so we need to sanitize it. It's not really # a config upgrade, since a user can at any time put - # some_key = '' - if my_val == '""' or my_val == "''": - my_val = '' + # some_key = 'some_val' + if type(my_val) in [str, path]: + my_val = my_val.strip('"').strip("'") except Exception: my_val = default self._config[section][ini_key] = str(my_val)