-
-
Notifications
You must be signed in to change notification settings - Fork 867
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
S3Boto3StorageFile always returns bytes iterator (not string) #404
Comments
+1, I was bit by this as well. With regular file storage, |
I think we can just pass |
Hi everybody, I've fixed the issue and made a PR (see above). Using S3Boto3Storage is now transparent, compatible with the Django provided FileStorage and doesn't require additional code. Please push package originator to include a PR into the next release |
Any chance the PR is going to be merged soon? |
Also blocking for us, any updates? Thanks! |
Fixing in #827. |
I'm experiencing this very same issue with the Should I open a new issue perhaps? |
Can you open a PR? |
When I run this code:
I get the following message:
The problem is that the _file property of S3Boto3StorageFile is always instantiated in 'w+b' mode in order to write the contents from the s3boto3 Object. Therefore, when I read from that file, the iterator always returns bytes, and not string.
I've worked around this problem by using the codecs library:
But I still think this issue should be resolved, since the S3Boto3Storage _open() function has a mode parameter.
The text was updated successfully, but these errors were encountered: