Skip to content

Commit

Permalink
Don't lsbuckets for isdir(bucket) (#856)
Browse files Browse the repository at this point in the history
  • Loading branch information
martindurant authored Mar 8, 2024
1 parent caf15c8 commit 0fbefba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion s3fs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,7 @@ async def _pipe_file(self, path, data, chunksize=50 * 2**20, **kwargs):
"create_multipart_upload", Bucket=bucket, Key=key, **kwargs
)

# TODO: cancel MPU if the following fails
out = [
await self._call_s3(
"upload_part",
Expand Down Expand Up @@ -1439,7 +1440,7 @@ async def _isdir(self, path):
path = self._strip_protocol(path).strip("/")
# Send buckets to super
if "/" not in path:
if path in await self._lsbuckets(path):
if path == "":
return True
try:
out = await self._lsdir(path)
Expand Down

0 comments on commit 0fbefba

Please sign in to comment.