Skip to content

s3fs rm fails silently #838

Open
Open
@dhirschfeld

Description

@dhirschfeld

I'm observing that rm is swallowing underlying errors and not deleting the files it was requested to delete:

>>> fs.rm(path)
[]
>>> fs.rm_file(path)
<snip>
File C:\python\envs\dev-py310\lib\site-packages\s3fs\core.py:1910, in S3FileSystem._rm_file(self, path, **kwargs)
   1907 self.invalidate_cache(path)
   1909 try:
-> 1910     await self._call_s3("delete_object", Bucket=bucket, Key=key)
   1911 except ClientError as e:
   1912     raise translate_boto_error(e)
  
PermissionError: Access Denied

i.e. rm is failing silently.

My expectation when I call rm is that only one of 2 things will happen - either:

  1. All files were deleted successfully
  2. Or an error is raised

I'm fine with some of the files having been deleted and some not so long as an exception is raised telling me that not all of the files/folders I requested to be deleted were able to be deleted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions