Skip to content

Commit

Permalink
[s3] do not try to decompress files opened in write mode jschneier#1282
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawgeek committed Apr 4, 2024
1 parent a3c3f99 commit 7dd2575
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storages/backends/s3boto3.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ def _get_file(self):
self._is_dirty = False
self.obj.download_fileobj(self._file)
self._file.seek(0)
if self._storage.gzip and self.obj.content_encoding == 'gzip':
self._file = GzipFile(mode=self._mode, fileobj=self._file, mtime=0.0)
if self._storage.gzip and self.obj.content_encoding == 'gzip':
self._file = GzipFile(mode=self._mode, fileobj=self._file, mtime=0.0)
return self._file

def _set_file(self, value):
Expand Down

0 comments on commit 7dd2575

Please sign in to comment.