From cf6dc2e83d917cbe97fa6c84253fad4553d8cc5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 5 Feb 2026 20:10:31 +0100 Subject: [PATCH] [config] improve --config-status - remove 'Not Present' output - add debug logs for exceptions - use correct type when reporting invalid data --- gallery_dl/config.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gallery_dl/config.py b/gallery_dl/config.py index 8354144f..d3d2d4db 100644 --- a/gallery_dl/config.py +++ b/gallery_dl/config.py @@ -155,13 +155,15 @@ def status(): with open(path, encoding="utf-8") as fp: _load(fp.read()) except FileNotFoundError: - status = "Not Present" - except OSError: + status = "" + except OSError as exc: + log.debug("%s: %s", exc.__class__.__name__, exc) status = "Inaccessible" - except ValueError: - status = "Invalid JSON" + except ValueError as exc: + log.debug("%s: %s", exc.__class__.__name__, exc) + status = "Invalid " + _type.upper() except Exception as exc: - log.debug(exc) + log.debug("%s: %s", exc.__class__.__name__, exc) status = "Unknown" else: status = "OK" @@ -169,7 +171,6 @@ def status(): paths.append((path, status)) fmt = f"{{:<{max(len(p[0]) for p in paths)}}} : {{}}\n".format - for path, status in paths: stdout_write(fmt(path, status))