Fix UnicodeDecodeErrors when sending e-mails with utf-8 contents.
Review Request #7553 — Created July 28, 2015 and submitted
When a review request e-mail had utf-8 in the body, it would fail to send
because of a UnicodeDecodeError while assembling the data that gets sent to the
server. The fix is a pretty trivial addition of some.encode()
calls.We hadn't caught this before because the test backend for e-mail in django
doesn't run through the same sort of internal processing as other backends do.
I've changed an existing test case and added a new one so that we use the
console e-mail backend while running the unicode tests, so that we exercise the
same machinery.
Ran unit tests. Before the encode changes, they failed. After, they succeed.
- Change Summary:
-
pep8
- Commit:
-
fe7be8309409d00bb4f7875d6141db8da6b10c9fda910ad393b61ae6bc1cb7d48edaaa747b397891
-
Tool: Pyflakes Processed Files: reviewboard/notifications/email.py reviewboard/notifications/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/notifications/email.py reviewboard/notifications/tests.py
- Change Summary:
-
Implement settings change as a context manager.
- Commit:
-
da910ad393b61ae6bc1cb7d48edaaa747b3978914ee41aac5b8915e43adf630350efca615836bb18