Skip to content
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
7 changes: 4 additions & 3 deletions fs_s3fs/_s3fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,9 +693,10 @@ def scandir(self, path, namespaces=None, page=None):
_s3_key = self._path_to_dir_key(_path)
prefix_len = len(_s3_key)

info = self.getinfo(path)
if not info.is_dir:
raise errors.DirectoryExpected(path)
if self.strict:
info = self.getinfo(path)
if not info.is_dir:
raise errors.DirectoryExpected(path)

paginator = self.client.get_paginator("list_objects")
_paginate = paginator.paginate(
Expand Down