From 13f1f5ef3cf6a5278e880661355ef74b7b77d3de Mon Sep 17 00:00:00 2001 From: 7x11x13 Date: Thu, 18 Nov 2021 00:51:57 -0500 Subject: [PATCH] Raise error if default config file cannot be read --- scdl/__init__.py | 2 +- scdl/scdl.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scdl/__init__.py b/scdl/__init__.py index acd0710..e4c9c95 100644 --- a/scdl/__init__.py +++ b/scdl/__init__.py @@ -2,4 +2,4 @@ """Python Soundcloud Music Downloader.""" -__version__ = "v2.2.1" \ No newline at end of file +__version__ = "v2.2.2" \ No newline at end of file diff --git a/scdl/scdl.py b/scdl/scdl.py index 00969a8..8fbd0d1 100755 --- a/scdl/scdl.py +++ b/scdl/scdl.py @@ -221,11 +221,11 @@ def get_config(config_file: pathlib.Path) -> configparser.ConfigParser: default_config_file = pathlib.Path(__file__).with_name("scdl.cfg") # load default config first - config.read(default_config_file) + config.read_file(open(default_config_file, encoding="UTF-8")) # load config file if it exists if config_file.exists(): - config.read(config_file) + config.read_file(open(config_file, encoding="UTF-8")) # save config to disk config_file.parent.mkdir(parents=True, exist_ok=True)