Commits

eikeon  committed 1a781f1

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 a59c9ea
  • Branches s3boto_listdir

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()