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
When S3Boto3Storage has gzip enabled, the following code generates an error when writing to an S3 key that does not already exist:
with my_storage.open('new_key.txt', 'wb') as f:
f.write(b'hello')
The stack trace indicates an error is happening for S3Boto3StorageFile._get_file():
...
if self._storage.gzip and self.obj.content_encoding == 'gzip':
self._file = GzipFile(mode=self._mode, fileobj=self._file, mtime=0.0)
Basically, by checking self.obj.content_encoding, Boto3 is performing a HeadObject() operation on the key, even though it doesn't exist yet, which is generating the 404.
Should the relevant code instead use the content-encoding guessed from the newly created file? That's what the S3Boto3Storage.save() method does and it doesn't have this issue.
The text was updated successfully, but these errors were encountered:
When
S3Boto3Storage
has gzip enabled, the following code generates an error when writing to an S3 key that does not already exist:The stack trace indicates an error is happening for
S3Boto3StorageFile._get_file()
:Basically, by checking
self.obj.content_encoding
, Boto3 is performing aHeadObject()
operation on the key, even though it doesn't exist yet, which is generating the 404.Should the relevant code instead use the content-encoding guessed from the newly created file? That's what the
S3Boto3Storage.save()
method does and it doesn't have this issue.The text was updated successfully, but these errors were encountered: