J'essaie d'obtenir la taille totale d'un compartiment. Cependant, total_size renvoie 0. Bien sûr, il y a quelques fichiers dans le compartiment. Si j'ai cinq fichiers dans mon compartiment, la fonction suivante imprime cinq zéros. Qu'est-ce que je fais mal?Impossible d'obtenir la taille totale d'un compartiment avec Boto3
bucket = boto3.resource('s3', config=Config(signature_version="s3", s3={'addressing_style': 'path'})).Bucket(name)
for object in bucket.objects.all():
total_size += object.size
print(object.size)