Opened 13 years ago
Closed 13 years ago
#17536 closed Bug (duplicate)
Filename encoding broken for attachments in EmailMessage class
Reported by: | alexey | Owned by: | nobody |
---|---|---|---|
Component: | Core (Mail) | Version: | dev |
Severity: | Normal | Keywords: | EmailMessage, broken encoding, unicode, i18n |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Message encoding broken if creating messages with EmailMessage class.
Test case:
subject = u"Тест" body = u"Тест" recepients = ["test@test.com"] filename = u"тест.txt" report = "some binary data" email = EmailMessage(subject,body,to=recepients) email.attach(filename.encode("utf-8"),report) email.send()
filename will NOT be properly encoded and pushed into the message "as is". And some email clients such as MS Outlook will show broken stuff instead of filename.
Note:
See TracTickets
for help on using tickets.
It seems that bug is in _create_attachment method. I solved this by monkey-patching: