py3: decode email headers with mail.headdecode() in notify extension stable
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 24 Oct 2019 15:50:15 +0200
branchstable
changeset 43328 416041f97cc3
parent 43327 ac33550f63e8
child 43329 33506cb43642
py3: decode email headers with mail.headdecode() in notify extension
hgext/notify.py
--- a/hgext/notify.py	Thu Oct 24 15:46:16 2019 +0200
+++ b/hgext/notify.py	Thu Oct 24 15:50:15 2019 +0200
@@ -391,9 +391,9 @@
         sender = msg[r'From']
         subject = msg[r'Subject']
         if sender is not None:
-            sender = encoding.strtolocal(sender)
+            sender = mail.headdecode(sender)
         if subject is not None:
-            subject = encoding.strtolocal(subject)
+            subject = mail.headdecode(subject)
         del msg[r'From'], msg[r'Subject']
 
         if not msg.is_multipart():