django-storages
django-storages copied to clipboard
Empty SpooledTemporaryFile` created when `closed` property is used multiple times
When GoogleCloudFile's closed property is used multiple times, the spooled temporary _file is created when its previously closed. This is because https://github.com/django/django/blob/6f453cd2981525b33925faaadc7a6e51fa90df5c/django/core/files/utils.py#L53 uses self.file which triggers a creation of _file regardless. As a result, when .close() is called after, an empty file is uploaded to GS.