You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I bumped into this bug when I was trying to make LibCloudStorage work with django's ManifestFilesMixin but that doesn't matter and it should be fixed regardless.
exact version of what it is now:
def _get_object(self, name):
"""Get object by its name. [Return None if object not found"""
clean_name = self._clean_name(name)
try:
return self.driver.get_object(self.bucket, clean_name)
except ObjectDoesNotExistError:
return None
def _read(self, name):
obj = self._get_object(name)
# TOFIX : we should be able to read chunk by chunk
return next(self.driver.download_object_as_stream(obj, obj.size))
my recommendation:
def _read(self, name):
obj = self._get_object(name)
if obj is None:
raise FileNotFoundError(f"{name} does not exist.")
# TOFIX : we should be able to read chunk by chunk
return next(self.driver.download_object_as_stream(obj, obj.size))
and if you are curious about the exact trigger of the bug:
class ManifestFilesMixin(HashedFilesMixin):
def read_manifest(self):
try:
with self.manifest_storage.open(self.manifest_name) as manifest:
return manifest.read().decode()
except FileNotFoundError:
return None
The text was updated successfully, but these errors were encountered:
engAmirEng
added a commit
to engAmirEng/django-storages
that referenced
this issue
Oct 27, 2022
I bumped into this bug when I was trying to make LibCloudStorage work with django's ManifestFilesMixin but that doesn't matter and it should be fixed regardless.
exact version of what it is now:
my recommendation:
and if you are curious about the exact trigger of the bug:
The text was updated successfully, but these errors were encountered: