-
-
Notifications
You must be signed in to change notification settings - Fork 866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty files on S3 after gzipping with Django 1.11 (s3boto) #367
Comments
A failing test case would be very helpful here. From reading the linked to Django changelog backwards incompat log it reads as though you have an issue on your side although I might be misunderstanding it. |
@jschneier I added a failing test with explanation :) |
Just confirming this issue. I ran into it and tracked it down very shortly after Django 1.11 was released, but got sidetracked and did not get it reported. |
Fixed in #373. Will release shortly. |
In Django 1.11.x there was a change in collectstatic command (here).
I noticed that after upgrade there is an issue with files uploaded to S3 when GZIP is enabled. Some files (post-processed by
ManifestFilesMixin
and used in its manifest file) are uploaded as empty files.I found that there is a potential issue with
_compress_content
method inS3Boto3Storage
class.Currently, the method looks like this:
When I use the storage and also use
ManifestFilesMixin
from Django thecontent.read()
returns an empty bytes object. If I addcontent.seek(0)
before everything works as expected.When I revert to Django 1.10.7 everything also works as expected. When I disable gzipping the files are also uploaded correctly.
The text was updated successfully, but these errors were encountered: