From 3de9f86332f032ac5681553fba5e0f423b2d7cf4 Mon Sep 17 00:00:00 2001 From: "Michael D. Smith" Date: Thu, 29 Aug 2024 06:41:05 -0400 Subject: [PATCH] update variable --- cloudpathlib/s3/s3client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cloudpathlib/s3/s3client.py b/cloudpathlib/s3/s3client.py index 4ef3d750..2f13dd38 100644 --- a/cloudpathlib/s3/s3client.py +++ b/cloudpathlib/s3/s3client.py @@ -156,7 +156,7 @@ def __init__( def _get_metadata(self, cloud_path: S3Path) -> Dict[str, Any]: # get accepts all download extra args - results = None + size = None path = f"s3://{cloud_path.bucket}/{cloud_path.key}" size = self._metadata_cache[cloud_path].size if size: @@ -313,9 +313,10 @@ def _list_dir(self, cloud_path: S3Path, recursive=False) -> Iterable[Tuple[S3Pat # yield object as file else: + path = self.CloudPath(f"s3://{cloud_path.bucket}/{result_key.get('Key')}") self._set_metadata_cache(path, "file", etag, size, last_modified) yield ( - self.CloudPath(f"s3://{cloud_path.bucket}/{result_key.get('Key')}"), + path, False, )