# HG changeset patch # User Denis Laxalde # Date 2019-11-12 16:12:16 # Node ID 849a3f81f46c7911d00acfbf82ea7435e33838be # Parent 94eac340d2123e2cf89a5f17ebd2f6f24a9a5278 mail: fix a bad return type in _encode() This particular instruction returned only a string and omitted the charset value. diff --git a/mercurial/mail.py b/mercurial/mail.py --- a/mercurial/mail.py +++ b/mercurial/mail.py @@ -336,7 +336,7 @@ def _encode(ui, s, charsets): 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.