diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -74,6 +74,7 @@ from __future__ import absolute_import import email as emailmod +import email.utils as eutil import errno import os import socket @@ -744,7 +745,7 @@ if not parent.endswith('>'): parent += '>' - sender_addr = emailmod.Utils.parseaddr(sender)[1] + sender_addr = eutil.parseaddr(pycompat.sysstr(sender))[1] sender = mail.addressencode(ui, sender, _charsets, opts.get('test')) sendmail = None firstpatch = None @@ -763,7 +764,7 @@ parent = m['Message-Id'] m['User-Agent'] = 'Mercurial-patchbomb/%s' % util.version() - m['Date'] = emailmod.Utils.formatdate(start_time[0], localtime=True) + m['Date'] = eutil.formatdate(start_time[0], localtime=True) start_time = (start_time[0] + 1, start_time[1]) m['From'] = sender