--- a/mercurial/mail.py Tue Nov 12 22:52:30 2019 +0100
+++ b/mercurial/mail.py Wed Nov 13 15:23:04 2019 +0100
@@ -263,8 +263,8 @@
return cs
-def mimetextpatch(s, subtype=b'plain', display=False):
- # type: (bytes, bytes, bool) -> email.message.Message
+def mimetextpatch(s, subtype='plain', display=False):
+ # type: (bytes, str, bool) -> email.message.Message
'''Return MIME message suitable for a patch.
Charset will be detected by first trying to decode as us-ascii, then utf-8,
and finally the global encodings. If all those fail, fall back to
@@ -290,13 +290,13 @@
def mimetextqp(body, subtype, charset):
- # type: (bytes, bytes, str) -> email.message.Message
+ # type: (bytes, str, str) -> email.message.Message
'''Return MIME message.
Quoted-printable transfer encoding will be used if necessary.
'''
cs = email.charset.Charset(charset)
msg = email.message.Message()
- msg.set_type(pycompat.sysstr(b'text/' + subtype))
+ msg.set_type('text/' + subtype)
for line in body.splitlines():
if len(line) > 950:
@@ -450,7 +450,7 @@
cs = 'us-ascii'
if not display:
s, cs = _encode(ui, s, charsets)
- return mimetextqp(s, b'plain', cs)
+ return mimetextqp(s, 'plain', cs)
if pycompat.ispy3: