From ba3c99b67d50f03cf9ceb1a7c8793f6fd0a8f95c Mon Sep 17 00:00:00 2001 From: pypeaday Date: Wed, 29 Nov 2023 05:42:56 -0600 Subject: [PATCH 1/2] Use .get for LastModified to mitigate KeyError --- s3fs/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3fs/core.py b/s3fs/core.py index b8f44010..cc0aaf86 100644 --- a/s3fs/core.py +++ b/s3fs/core.py @@ -1309,7 +1309,7 @@ async def _info(self, path, bucket=None, key=None, refresh=False, version_id=Non ) return { "ETag": out.get("ETag", ""), - "LastModified": out["LastModified"], + "LastModified": out("LastModified", ""), "size": out["ContentLength"], "name": "/".join([bucket, key]), "type": "file", From f45125b2f9676818a9c3d7405aa72f3ee76d6a18 Mon Sep 17 00:00:00 2001 From: Martin Durant Date: Wed, 29 Nov 2023 09:20:28 -0500 Subject: [PATCH 2/2] Update s3fs/core.py --- s3fs/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3fs/core.py b/s3fs/core.py index cc0aaf86..64fb1443 100644 --- a/s3fs/core.py +++ b/s3fs/core.py @@ -1309,7 +1309,7 @@ async def _info(self, path, bucket=None, key=None, refresh=False, version_id=Non ) return { "ETag": out.get("ETag", ""), - "LastModified": out("LastModified", ""), + "LastModified": out.get("LastModified", ""), "size": out["ContentLength"], "name": "/".join([bucket, key]), "type": "file",