changeset 43624:849a3f81f46c

mail: fix a bad return type in _encode() This particular instruction returned only a string and omitted the charset value.
author Denis Laxalde <denis.laxalde@logilab.fr>
date Tue, 12 Nov 2019 17:12:16 +0100
parents 94eac340d212
children 8d9e2c2b6058
files mercurial/mail.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/mail.py	Mon Nov 11 18:55:42 2019 -0800
+++ b/mercurial/mail.py	Tue Nov 12 17:12:16 2019 +0100
@@ -336,7 +336,7 @@
                 ui.warn(_(b'ignoring invalid sendcharset: %s\n') % ocs)
         else:
             # Everything failed, ascii-armor what we've got and send it.
-            return s.encode('ascii', 'backslashreplace')
+            return s.encode('ascii', 'backslashreplace'), b'us-ascii'
     # We have a bytes of unknown encoding. We'll try and guess a valid
     # encoding, falling back to pretending we had ascii even though we
     # know that's wrong.