diff --git a/changelog.d/20231012_145036_maria_fix_getting_cs_content_when_s3_contains_empty_dirs.md b/changelog.d/20231012_145036_maria_fix_getting_cs_content_when_s3_contains_empty_dirs.md new file mode 100644 index 000000000000..7ac19bf69e4d --- /dev/null +++ b/changelog.d/20231012_145036_maria_fix_getting_cs_content_when_s3_contains_empty_dirs.md @@ -0,0 +1,4 @@ +### Fixed + +- Getting CS content when S3 bucket contains manually created directories + () diff --git a/cvat/apps/engine/cloud_provider.py b/cvat/apps/engine/cloud_provider.py index 4083ff71394e..ab9474de17f9 100644 --- a/cvat/apps/engine/cloud_provider.py +++ b/cvat/apps/engine/cloud_provider.py @@ -467,7 +467,7 @@ def _list_raw_content_on_one_page( **({'Prefix': prefix} if prefix else {}), **({'ContinuationToken': next_token} if next_token else {}), ) - files = [f['Key'] for f in response.get('Contents', [])] + files = [f['Key'] for f in response.get('Contents', []) if not f['Key'].endswith('/')] directories = [p['Prefix'] for p in response.get('CommonPrefixes', [])] return {