diff options
Diffstat (limited to 'gallery_dl/output.py')
| -rw-r--r-- | gallery_dl/output.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gallery_dl/output.py b/gallery_dl/output.py index c0971f0..2bcc222 100644 --- a/gallery_dl/output.py +++ b/gallery_dl/output.py @@ -224,6 +224,9 @@ def setup_logging_handler(key, fmt=LOG_FORMAT, lvl=LOG_LEVEL, mode="w"): try: path = util.expand_path(path) handler = logging.FileHandler(path, mode, encoding) + except FileNotFoundError: + os.makedirs(os.path.dirname(path)) + handler = logging.FileHandler(path, mode, encoding) except (OSError, ValueError) as exc: logging.getLogger("gallery-dl").warning( "%s: %s", key, exc) |
