From patchwork Thu Oct 24 15:30:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [02,of,10,STABLE] py3: use as_bytes() method of EmailMessage From: Denis Laxalde X-Patchwork-Id: 42569 Message-Id: <07e05c72d451036707ac.1571931033@steppe.local> To: mercurial-devel@mercurial-scm.org Date: Thu, 24 Oct 2019 17:30:33 +0200 # HG changeset patch # User Denis Laxalde # Date 1570708110 -7200 # Thu Oct 10 13:48:30 2019 +0200 # Branch stable # Node ID 07e05c72d451036707ac8c7f9a283617ac9534f8 # Parent 4e91ce8060e960bd8f9656a1f9b00fdb82199b3c py3: use as_bytes() method of EmailMessage In Python 3, as_bytes() corresponds to as_string() in Python 2. diff --git a/hgext/notify.py b/hgext/notify.py --- a/hgext/notify.py +++ b/hgext/notify.py @@ -440,7 +440,7 @@ class notifier(object): msg[r'Message-Id'] = messageid(ctx, self.domain, self.messageidseed) msg[r'To'] = encoding.strfromlocal(b', '.join(sorted(subs))) - msgtext = encoding.strtolocal(msg.as_string()) + msgtext = msg.as_bytes() if pycompat.ispy3 else msg.as_string() if self.test: self.ui.write(msgtext) if not msgtext.endswith(b'\n'):