##// END OF EJS Templates
mail: convert addr to str early in addrlistencode()
Denis Laxalde -
r43977:599e25ad default
parent child Browse files
Show More
@@ -400,15 +400,15 b' def addrlistencode(ui, addrs, charsets=N'
400 400 '''Turns a list of addresses into a list of RFC-2047 compliant headers.
401 401 A single element of input list may contain multiple addresses, but output
402 402 always has one address per item'''
403 straddrs = []
403 404 for a in addrs:
404 405 assert isinstance(a, bytes), '%r unexpectedly not a bytestr' % a
406 straddrs.append(encoding.strfromlocal(a))
405 407 if display:
406 return [encoding.strfromlocal(a.strip()) for a in addrs if a.strip()]
408 return [a.strip() for a in straddrs if a.strip()]
407 409
408 410 result = []
409 for name, addr in email.utils.getaddresses(
410 [encoding.strfromlocal(a) for a in addrs]
411 ):
411 for name, addr in email.utils.getaddresses(straddrs):
412 412 if name or addr:
413 413 r = _addressencode(ui, name, encoding.strtolocal(addr), charsets)
414 414 result.append(r)
General Comments 0
You need to be logged in to leave comments. Login now