From b7ca2d37543e41046d149d9289ad3c8ffbc78303 Mon Sep 17 00:00:00 2001 From: Yoel Ross Date: Wed, 29 Jun 2022 15:27:37 +0300 Subject: [PATCH] catch missing s3keep case --- s3contents/genericmanager.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/s3contents/genericmanager.py b/s3contents/genericmanager.py index 73eb8e1..ecffa18 100644 --- a/s3contents/genericmanager.py +++ b/s3contents/genericmanager.py @@ -217,8 +217,11 @@ async def get_content_s3_metadata(self, s3_details): async def s3_detail_metadata(s3_detail): if s3_detail["StorageClass"] == "DIRECTORY": dir_path = os.path.join(self.fs.path(s3_detail["Key"]), ".s3keep") - lstat = await self.fs.fs._info(dir_path) - s3_detail['LastModified'] = lstat['LastModified'] + try: + lstat = await self.fs.fs._info(dir_path) + s3_detail['LastModified'] = lstat['LastModified'] + except FileNotFoundError: + pass st_time = s3_detail.get("LastModified") if st_time: s3_detail["ST_MTIME"] = datetime.datetime(