Mercurial > hg
changeset 43329:33506cb43642 stable
py3: decode payload of notify email
This fixes one UnicodeEncodeError in test-notify.t:422 when testing the
notify hook with non-ascii content (there are more later). We only
decode on Python 3, since it's not safe for sure on Python 2.
author | Denis Laxalde <denis.laxalde@logilab.fr> |
---|---|
date | Thu, 24 Oct 2019 16:34:43 +0200 |
parents | 416041f97cc3 |
children | 910827a2cb20 |
files | hgext/notify.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/notify.py Thu Oct 24 15:50:15 2019 +0200 +++ b/hgext/notify.py Thu Oct 24 16:34:43 2019 +0200 @@ -400,7 +400,7 @@ # create fresh mime message from scratch # (multipart templates must take care of this themselves) headers = msg.items() - payload = msg.get_payload() + payload = msg.get_payload(decode=pycompat.ispy3) # for notification prefer readability over data precision msg = mail.mimeencode(self.ui, payload, self.charsets, self.test) # reinstate custom headers