Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue #68: decode key before list_objects #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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