Skip to content

Commit

Permalink
Fix for issue #68: decode key before list_objects
Browse files Browse the repository at this point in the history
  • Loading branch information
ChinnoDog committed Jul 15, 2024
1 parent 7f95af6 commit bb4751e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs_s3fs/_s3fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from fs.subfs import SubFS
from fs.path import basename, dirname, forcedir, join, normpath, relpath
from fs.time import datetime_to_epoch
from urllib.parse import unquote


def _make_repr(class_name, *args, **kwargs):
Expand Down Expand Up @@ -716,10 +717,11 @@ def gen_info():
}
yield Info(info)
for _obj in result.get("Contents", ()):
name = _obj["Key"][prefix_len:]
_key = unquote(_obj["Key"])
name = _key[prefix_len:]
if name:
with s3errors(path):
obj = self.s3.Object(self._bucket_name, _obj["Key"])
obj = self.s3.Object(self._bucket_name, _key)
info = self._info_from_object(obj, namespaces)
yield Info(info)

Expand Down

0 comments on commit bb4751e

Please sign in to comment.