--- a/mercurial/mail.py Sun Aug 12 12:11:36 2018 +0900
+++ b/mercurial/mail.py Sun Aug 12 12:14:28 2018 +0900
@@ -312,7 +312,7 @@
name = headencode(ui, name, charsets)
try:
acc, dom = addr.split('@')
- acc = acc.encode('ascii')
+ acc.decode('ascii')
dom = dom.decode(encoding.encoding).encode('idna')
addr = '%s@%s' % (acc, dom)
except UnicodeDecodeError:
@@ -320,7 +320,7 @@
except ValueError:
try:
# too strict?
- addr = addr.encode('ascii')
+ addr.decode('ascii')
except UnicodeDecodeError:
raise error.Abort(_('invalid local address: %s') % addr)
return pycompat.bytesurl(