From cc529868112ad11cfd2feb00a241516472fce5bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 14 Feb 2026 14:55:13 +0100 Subject: [PATCH] [config] fix 'JSONDecodeError' when using non-JSON config types (#9063) fixes regression introduced in 56f27906268a860b610d7e311faf9683876cf4d5 --- gallery_dl/config.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gallery_dl/config.py b/gallery_dl/config.py index 1323bda3..223e4816 100644 --- a/gallery_dl/config.py +++ b/gallery_dl/config.py @@ -73,6 +73,9 @@ def default(type=None): )) +default(os.environ.get("GDL_CONFIG_TYPE")) + + def initialize(): paths = list(map(util.expand_path, _default_configs)) @@ -211,8 +214,11 @@ def remap_categories(): opts[new] = opts[old] -def load(files=None, strict=False, loads=_load, conf=_config): - """Load JSON configuration files""" +def load(files=None, strict=False, loads=None, conf=_config): + """Load configuration files""" + if loads is None: + loads = _load + for pathfmt in files or _default_configs: path = util.expand_path(pathfmt) try: @@ -374,6 +380,3 @@ class apply(): unset(path, key) else: set(path, key, value) - - -default(os.environ.get("GDL_CONFIG_TYPE"))