Unpacking s3.ObjectSummary from bucket.objects.all() iteration

Viewed 4949

I'm using boto3 to download files from s3, and i'm trying to unpack the values from bucket.objects.all() iteration:

bucket = boto3.Session(profile_name='default').resource('s3').Bucket(bucket_name)
for (bucket_name, key) in zip(bucket.objects.all()):
   print(bucket_name, key)

But this is returning the following error:

ValueError: not enough values to unpack (expected 2, got 1)

What I'm doing wrongly?

1 Answers
Related