Skip to content

Commit

Permalink
[s3] do not try to decompress files opened in write mode (#1282)
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneier committed Aug 27, 2023
1 parent 7b625b8 commit e7e5bb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storages/backends/s3boto3.py
Expand Up @@ -148,8 +148,8 @@ def _get_file(self):
self._is_dirty = False
self.obj.download_fileobj(self._file, Config=self._storage.transfer_config)
self._file.seek(0)
if self._storage.gzip and self.obj.content_encoding == 'gzip':
self._file = self._decompress_file(mode=self._mode, file=self._file)
if self._storage.gzip and self.obj.content_encoding == 'gzip':
self._file = self._decompress_file(mode=self._mode, file=self._file)
return self._file

def _set_file(self, value):
Expand Down

0 comments on commit e7e5bb3

Please sign in to comment.