From 590f2e270cd88cff64ac8aac9bfab848916eb5ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 14 Aug 2022 17:42:42 +0200 Subject: [PATCH] [postprocessor:metadata] fix error with '..' in directory --- gallery_dl/postprocessor/metadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gallery_dl/postprocessor/metadata.py b/gallery_dl/postprocessor/metadata.py index a242c9416b..d9baed3bd5 100644 --- a/gallery_dl/postprocessor/metadata.py +++ b/gallery_dl/postprocessor/metadata.py @@ -110,7 +110,7 @@ def run(self, pathfmt): with open(path, "w", encoding="utf-8") as fp: self.write(fp, pathfmt.kwdict) except FileNotFoundError: - os.makedirs(directory) + os.makedirs(directory, exist_ok=True) with open(path, "w", encoding="utf-8") as fp: self.write(fp, pathfmt.kwdict)