Mercurial > public > mercurial-scm > hg-stable
diff hgext/patchbomb.py @ 43624:14b96072797d
mail: let addressencode() / addrlistencode() return native strings
Avoids conversion to "str" on py3.
author | Denis Laxalde <denis@laxalde.org> |
---|---|
date | Sat, 09 Nov 2019 15:16:52 +0100 |
parents | 9f70512ae2cf |
children | cbcd72844df1 |
line wrap: on
line diff
--- a/hgext/patchbomb.py Sat Nov 09 12:45:14 2019 +0100 +++ b/hgext/patchbomb.py Sat Nov 09 15:16:52 2019 +0100 @@ -943,13 +943,13 @@ start_time = (start_time[0] + 1, start_time[1]) m[b'From'] = sender - m[b'To'] = b', '.join(to) + m[b'To'] = ', '.join(to) if cc: - m[b'Cc'] = b', '.join(cc) + m[b'Cc'] = ', '.join(cc) if bcc: - m[b'Bcc'] = b', '.join(bcc) + m[b'Bcc'] = ', '.join(bcc) if replyto: - m[b'Reply-To'] = b', '.join(replyto) + m[b'Reply-To'] = ', '.join(replyto) # Fix up all headers to be native strings. # TODO(durin42): this should probably be cleaned up above in the future. if pycompat.ispy3: @@ -992,7 +992,6 @@ generator = mail.Generator(fp, mangle_from_=False) generator.flatten(m, 0) alldests = to + bcc + cc - alldests = [encoding.strfromlocal(d) for d in alldests] sendmail(sender_addr, alldests, fp.getvalue()) progress.complete()