Commits

eikeon  committed 38627a1

added trailing / to name else bucket.list will often return too much; fixes http://code.welldev.org/django-storages/issue/57/s3boto-listdir-is-broken

  • Participants
  • Parent commits d5bd7f4

Comments (0)

Files changed (1)

File storages/backends/s3boto.py

     
     def listdir(self, name):
         name = self._normalize_name(self._clean_name(name))
+        if not name.endswith("/"):
+            # for the bucket.list and logic below name needs to end in /
+            name = "%s/" % name
         dirlist = self.bucket.list(self._encode_name(name))
         files = []
         dirs = set()