From d4fdee1e9f81d0a3d0e07a0e6a9004953fb62cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Mon, 23 Dec 2019 14:03:31 -0500 Subject: [PATCH] Fix for #711. --- bazarr/config.py | 6 +++++- libs/simpleconfigparser/__init__.py | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bazarr/config.py b/bazarr/config.py index deea48731..ca61871e0 100644 --- a/bazarr/config.py +++ b/bazarr/config.py @@ -5,6 +5,7 @@ import os from simpleconfigparser import simpleconfigparser from get_args import args +from six import PY3 defaults = { 'general': { @@ -139,7 +140,10 @@ defaults = { } } -settings = simpleconfigparser(defaults=defaults) +if PY3: + settings = simpleconfigparser(defaults=defaults, interpolation=None) +else: + settings = simpleconfigparser(defaults=defaults) settings.read(os.path.join(args.config_dir, 'config', 'config.ini')) base_url = settings.general.base_url diff --git a/libs/simpleconfigparser/__init__.py b/libs/simpleconfigparser/__init__.py index 9cce999b9..c84ccbacc 100644 --- a/libs/simpleconfigparser/__init__.py +++ b/libs/simpleconfigparser/__init__.py @@ -26,7 +26,7 @@ THE SOFTWARE. try: from configparser import ConfigParser as configparser, NoOptionError, NoSectionError except ImportError: - from ConfigParser import SafeConfigParser as configparser, NoOptionError, NoSectionError + from ConfigParser import RawConfigParser as configparser, NoOptionError, NoSectionError class simpleconfigparser(configparser): @@ -126,6 +126,6 @@ class simpleconfigparser(configparser): def get(self, section, option, raw=False, vars=None, fallback=None): try: # Strip out quotes from the edges - return configparser.get(self, section, option, raw=raw, vars=vars).strip('"\'') + return configparser.get(self, section, option).strip('"\'') except NoOptionError: return None