[PATCH 09 of 10 STABLE] py3: decode email headers with mail.headdecode() in notify extension

Denis Laxalde denis at laxalde.org
Thu Oct 24 11:30:40 EDT 2019


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1571925015 -7200
#      Thu Oct 24 15:50:15 2019 +0200
# Branch stable
# Node ID b3070247092e461d15f0921618b94a2b1646fdf1
# Parent  ea82b3a69f6ae2e83ecf905c4f9123a778d12f5e
py3: decode email headers with mail.headdecode() in notify extension

diff --git a/hgext/notify.py b/hgext/notify.py
--- a/hgext/notify.py
+++ b/hgext/notify.py
@@ -391,9 +391,9 @@ class notifier(object):
         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():


More information about the Mercurial-devel mailing list