comparison mercurial/mail.py @ 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 599e25add437
children 8d9e2c2b6058
comparison
equal deleted inserted replaced
43623:94eac340d212 43624:849a3f81f46c
334 pass 334 pass
335 except LookupError: 335 except LookupError:
336 ui.warn(_(b'ignoring invalid sendcharset: %s\n') % ocs) 336 ui.warn(_(b'ignoring invalid sendcharset: %s\n') % ocs)
337 else: 337 else:
338 # Everything failed, ascii-armor what we've got and send it. 338 # Everything failed, ascii-armor what we've got and send it.
339 return s.encode('ascii', 'backslashreplace') 339 return s.encode('ascii', 'backslashreplace'), b'us-ascii'
340 # We have a bytes of unknown encoding. We'll try and guess a valid 340 # We have a bytes of unknown encoding. We'll try and guess a valid
341 # encoding, falling back to pretending we had ascii even though we 341 # encoding, falling back to pretending we had ascii even though we
342 # know that's wrong. 342 # know that's wrong.
343 try: 343 try:
344 s.decode('ascii') 344 s.decode('ascii')