From 0fbefba934073830075e02f4c2246c3521a15b10 Mon Sep 17 00:00:00 2001 From: Martin Durant Date: Fri, 8 Mar 2024 16:13:29 -0500 Subject: [PATCH] Don't lsbuckets for isdir(bucket) (#856) --- s3fs/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/s3fs/core.py b/s3fs/core.py index 7240d1c9..076a69d8 100644 --- a/s3fs/core.py +++ b/s3fs/core.py @@ -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", @@ -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)