diff -r ef661ce45cdb -r 7edf68862fe3 mercurial/mail.py --- a/mercurial/mail.py Sun Apr 08 15:03:00 2018 +0900 +++ b/mercurial/mail.py Sun Apr 08 15:22:30 2018 +0900 @@ -332,6 +332,11 @@ continue except UnicodeDecodeError: pass + # On Python 3, decode_header() may return either bytes or unicode + # depending on whether the header has =?? or not + if isinstance(part, type(u'')): + uparts.append(part) + continue try: uparts.append(part.decode('UTF-8')) continue