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
10 changes: 8 additions & 2 deletions s3fs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class S3FileSystem(AsyncFileSystem):
for performance reasons. When set to True, filesystem instances will
use the S3 ListObjectVersions API call to list directory contents,
which requires listing all historical object versions.
cache_regions : bool (False)
cache_regions : bool (True)
Whether to cache bucket regions or not. Whenever a new bucket is used,
it will first find out which region it belongs and then use the client
for that region.
Expand Down Expand Up @@ -278,7 +278,7 @@ def __init__(
session=None,
username=None,
password=None,
cache_regions=False,
cache_regions=True,
asynchronous=False,
loop=None,
**kwargs,
Expand Down Expand Up @@ -899,6 +899,12 @@ async def _makedirs(self, path, exist_ok=False):
makedirs = sync_wrapper(_makedirs)

async def _rmdir(self, path):
path = self._strip_protocol(path).rstrip("/")
if "/" in path:
if await self._exists(path):
# did you mean rm(path, recursive=True) ?
raise FileExistsError
raise FileNotFoundError
try:
await self._call_s3("delete_bucket", Bucket=path)
except botocore.exceptions.ClientError as e:
Expand Down