From 46f68e2e92289b50b2170e5a8dfb785c43643c92 Mon Sep 17 00:00:00 2001 From: Christoph Stahl Date: Mon, 30 Sep 2024 14:39:13 +0200 Subject: [PATCH] create cache directory, if not exists --- syng/sources/s3.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/syng/sources/s3.py b/syng/sources/s3.py index c30d5b5..f69f447 100644 --- a/syng/sources/s3.py +++ b/syng/sources/s3.py @@ -94,6 +94,8 @@ class S3Source(FileBasedSource): if obj.object_name is not None and self.has_correct_extension(obj.object_name) ] if self.index_file is not None and not os.path.isfile(self.index_file): + os.makedirs(os.path.dirname(self.index_file), exist_ok=True) + with open(self.index_file, "w", encoding="utf8") as index_file_handle: dump(file_list, index_file_handle) return file_list