Raise error if default config file cannot be read

master
7x11x13 2021-11-18 00:51:57 -05:00
parent 03be1c45db
commit 13f1f5ef3c
2 changed files with 3 additions and 3 deletions

View File

@ -2,4 +2,4 @@
"""Python Soundcloud Music Downloader."""
__version__ = "v2.2.1"
__version__ = "v2.2.2"

View File

@ -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)