changeset 39108:d2d89d31cbb5

mail: convert encoding.encoding to sysstr
author Yuya Nishihara <yuya@tcha.org>
date Sun, 12 Aug 2018 12:16:08 +0900
parents c2327bb3505d
children a915db9a5e77
files mercurial/mail.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/mail.py	Sun Aug 12 12:14:28 2018 +0900
+++ b/mercurial/mail.py	Sun Aug 12 12:16:08 2018 +0900
@@ -313,7 +313,7 @@
     try:
         acc, dom = addr.split('@')
         acc.decode('ascii')
-        dom = dom.decode(encoding.encoding).encode('idna')
+        dom = dom.decode(pycompat.sysstr(encoding.encoding)).encode('idna')
         addr = '%s@%s' % (acc, dom)
     except UnicodeDecodeError:
         raise error.Abort(_('invalid email address: %s') % addr)