-
-
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
S3Boto3Storage: fix for file-like objects without name, multipart upload support #195
Conversation
👍 on seeing the SHA error. We've worked around it by ensuring we pass a |
@linuxlewis Hi, can you show me where it's already fixed? |
@pacahon The "fix" is just a workaround in our code. We do something like this... from cStringIO import StringIO
from django.core.files.storage import default_storage
from django.core.files.base import File
default_storage.save('filename.txt', File(StringIO('content'), name='filename.txt')) |
@linuxlewis Thanks, that was my first thought. But |
upload_fileobj method supports multipart upload while put method limits to ~5gb Avoid django-specific logic on saving python file-like objects without name
Codecov Report@@ Coverage Diff @@
## master #195 +/- ##
==========================================
+ Coverage 59.32% 59.85% +0.53%
==========================================
Files 17 17
Lines 1694 1684 -10
==========================================
+ Hits 1005 1008 +3
+ Misses 689 676 -13
Continue to review full report at Codecov.
|
Should check if already was documented that |
PR needs rebasing but looks good to merge. @jschneier |
Updated and will be applied in #368. Thanks for the report and patch. Apologies for the delay. |
In fact, it's partially solves problem. If we pass subclass of
File
class and forgot override__bool__
method - an error based on empty name still can occur.