-
-
Notifications
You must be signed in to change notification settings - Fork 866
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
trying to delete a non existing blob in gcloud raises a NotFound exception #998
Comments
Personally, I mostly use the gcloud implementation, so not familiar with the details of the other storages. However, I do not think |
That might be true for other cases, but not raising an exception is the expected behaviour for a django storage. It currently makes the gcloud backend inconsistent to the other backend implementations and the django native file storage (https://github.com/django/django/blob/main/django/core/files/storage.py#L306). |
I find it surprising that the It's not clear to me the storage backends should be suppressing the error either. |
@jschneier it may not ideal but it is consistent to all other implementations (including Django's native files storage implementation). Having one that is different makes things complicated and inconsistent. Can you please consider merging the patch or ultimately decline it? In the latter I would at least create a pull request to document the inconsistency. |
When trying to delete a blob with gcloud as backend, a 404
google.cloud.exceptions.NotFound
exception is raised.This is different when using S3 or Azure.
In Google docs:
If the blob isn’t found (backend 404), raises a google.cloud.exceptions.NotFound.
https://googleapis.dev/python/storage/latest/buckets.html#google.cloud.storage.bucket.Bucket.delete_blob
This is due to missing exception handling around the delete_blob call in https://github.com/jschneier/django-storages/blob/master/storages/backends/gcloud.py#L165
The azure backend is wrapping the `delete_blob' call with an exception handling:
https://github.com/jschneier/django-storages/blob/master/storages/backends/azure_storage.py#L228-L234
The text was updated successfully, but these errors were encountered: