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

Comlink: Emails With Attachments Fail #377

Closed
jsayles opened this issue Jan 12, 2018 · 1 comment
Closed

Comlink: Emails With Attachments Fail #377

jsayles opened this issue Jan 12, 2018 · 1 comment

Comments

@jsayles
Copy link
Member

jsayles commented Jan 12, 2018

Emails to staff@ or team@ that have a word doc attachment fail to send with the following error. It is not clear if this is all attachment types or just word documents.

Exception:
'utf-8' codec can't decode byte 0x85 in position 16: invalid start byte

The problem stems from the Python3 conversion and is specifically at line 100 in mailgun.mailgun_send where the attachment files are added to the requests.post.

The files are retrieved using open(path) in comlink.signals line 29. This returns a TextIOWrapper in UTF-8 encoding. When that wrapper is accessed, the exception is thrown.

@jsayles
Copy link
Member Author

jsayles commented Jan 12, 2018

I added a mode='rb' in the open command to pull the attachment data in as binary.

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

1 participant