Patchwork D2149: py3: pass system string to email.message.Message.set_type()

login
register
mail settings
Submitter phabricator
Date Feb. 12, 2018, 1:40 a.m.
Message ID <769de2883723d021953886000e90cddf@localhost.localdomain>
Download mbox | patch
Permalink /patch/27613/
State Not Applicable
Headers show

Comments

phabricator - Feb. 12, 2018, 1:40 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG1407c42b302c: py3: pass system string to email.message.Message.set_type() (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2149?vs=5434&id=5448

REVISION DETAIL
  https://phab.mercurial-scm.org/D2149

AFFECTED FILES
  mercurial/mail.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -20,6 +20,7 @@ 
 from . import (
     encoding,
     error,
+    pycompat,
     sslutil,
     util,
 )
@@ -218,7 +219,7 @@ 
     '''
     cs = email.charset.Charset(charset)
     msg = email.message.Message()
-    msg.set_type('text/' + subtype)
+    msg.set_type(pycompat.sysstr('text/' + subtype))
 
     for line in body.splitlines():
         if len(line) > 950: