From d70ac77991716c39a31550be639b73af580e1b00 Mon Sep 17 00:00:00 2001 From: mr-bo-jangles Date: Tue, 1 Aug 2017 07:52:31 +0100 Subject: [PATCH] Ensure that we're reading the file from the start (#373) --- storages/backends/s3boto3.py | 1 + 1 file changed, 1 insertion(+) diff --git a/storages/backends/s3boto3.py b/storages/backends/s3boto3.py index 727782f76..212179004 100644 --- a/storages/backends/s3boto3.py +++ b/storages/backends/s3boto3.py @@ -387,6 +387,7 @@ def _decode_name(self, name): def _compress_content(self, content): """Gzip a given string content.""" + content.seek(0) zbuf = BytesIO() zfile = GzipFile(mode='wb', compresslevel=6, fileobj=zbuf) try: