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 have encountered an error in BackblazeB2Storage detailed below.
This happens at least in b2sdk 1.7.0 and 1.8.0 (didn't check earlier versions at the moment)
I guess there was a breaking change in b2sdk.
from djano.db import models
from django_backblaze_b2 import BackblazeB2Storage
class SomeModel(models.Model):
file = models.FileField(
storage=BackblazeB2Storage, blank=True
)
obj = SomeModel(file="key/of/existing/file.pdf")
# This raises the exception below
# If a non-existent file path was given, it returns 0 instead.
obj.file.size
# This works
x.file.storage._fileInfo(x.file.name).size
-------------------------------------------------------
File "/usr/local/lib/python3.8/site-packages/django/db/models/fields/files.py", line 70, in size
return self.storage.size(self.name)
File "/usr/local/lib/python3.8/site-packages/django_backblaze_b2/storage.py", line 210, in size
return fileInfo.get("size", 0) if fileInfo else 0
AttributeError: 'FileVersionInfo' object has no attribute 'get'
The text was updated successfully, but these errors were encountered:
For reference, waiting on a 1.9.0 release. I submitted a bugfix to the b2sdk. Looks like the bug you encountered was actually in my implementation, but might as well release a more up-to-date implementation.
I have encountered an error in BackblazeB2Storage detailed below.
This happens at least in b2sdk 1.7.0 and 1.8.0 (didn't check earlier versions at the moment)
I guess there was a breaking change in b2sdk.
The text was updated successfully, but these errors were encountered: