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

Unicode-objects must be encoded before hashing - update from 1.8 to 1.9.1 #843

Closed
IrinaAlexandra opened this issue Feb 24, 2020 · 3 comments

Comments

@IrinaAlexandra
Copy link

IrinaAlexandra commented Feb 24, 2020

So we've recently updated from version to 1.8 to version 1.9.1. Now we have a TypeError: Unicode-objects must be encoded before hashing when saving to s3.

Code:

file = ContentFile("")
document.save_csv_file(file) #writes to csv file using csv library
example_django_model.file.save(file_name, file, save=False)

I then proceed to receive the same error as in #708 . Even though that issue was closed a long time ago (with the solution of doing ContentFile(b'')), the code above was working fine in version 1.8. What has changed in 1.9.1 that is now causing this encoding error?

@LincolnPuzey
Copy link
Contributor

Did you also update your botocore/boto3 version?

On 2018-11-30 botocore published version 1.12.57 with the change "bugfix:s3: Add md5 header injection to new operations that require it"

I haven't looked at the actual code that changed there but I suspect that botocore is now calculating md5 hashes of uploads.

@mertcangokgoz
Copy link

any Update?

@jschneier
Copy link
Owner

Fixed by #911

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

No branches or pull requests

4 participants