Skip to content
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

Support saving file objects that aren't seekable in S3Boto3Storage #1057

Merged

Conversation

vainu-arto
Copy link
Contributor

  • Move the seek to happen before compression instead of after
  • Only seek if content.seekable() is true

Fixes issue #860.

@vainu-arto vainu-arto force-pushed the S3Boto3Storage-save-non-seekable branch from c3835ae to 304b1b0 Compare September 16, 2021 09:19
@jschneier jschneier merged commit 4b55b2e into jschneier:master Sep 19, 2021
jschneier pushed a commit that referenced this pull request Sep 19, 2021
* Seek content to zero only once, before compressing

* Only seek in S3Boto3Storage._save if content is seekable

Also add tests to verify the behavior. This fixes issue #860.
@vainu-arto vainu-arto deleted the S3Boto3Storage-save-non-seekable branch September 20, 2021 03:57
mlazowik pushed a commit to qedsoftware/django-storages that referenced this pull request Mar 9, 2022
)

* Seek content to zero only once, before compressing

* Only seek in S3Boto3Storage._save if content is seekable

Also add tests to verify the behavior. This fixes issue jschneier#860.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants