Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

ghislainp
Copy link
Contributor

@ghislainp ghislainp commented Mar 25, 2024

Fixes fsspec/filesystem_spec#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
Copy link
Member

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

@ghislainp
Copy link
Contributor Author

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
Copy link
Member

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

@martindurant martindurant merged commit 7ccc0a5 into fsspec:main Mar 26, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fs.rm(filename, recursive=True) fails with a strange error
2 participants