fsspec / s3fs

S3 Filesystem
http://s3fs.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
892 stars 274 forks source link

_bulk_delete must always return a list, even when pathlist is empty #866

Closed ghislainp closed 8 months ago

ghislainp commented 8 months ago

Fixes https://github.com/fsspec/filesystem_spec/issues/1557

_bulk_delete returned None (no return) when pathlist is empty which is incompatible with the list returned in normal operation. This causes a bug in fsspec for instance, because a list was expected. This change returns an empty list when pathlist is empty

martindurant commented 8 months ago

Would calling bulk_delete with an empty list have triggered the error? If so, we can use that as a test.

ghislainp commented 8 months ago

no unfortunately, my problem is coming from elsewhere...

I have just tried calling fs.rm([], recursive=True) but it raise an exception file not found... an expected behavior I believe.

martindurant commented 8 months ago

OK, I understand why this is correct - but I don't know why the situation occurs in the first place.