comparison hgext/notify.py @ 43328:416041f97cc3 stable

py3: decode email headers with mail.headdecode() in notify extension
author Denis Laxalde <denis.laxalde@logilab.fr>
date Thu, 24 Oct 2019 15:50:15 +0200
parents ac33550f63e8
children 33506cb43642
comparison
equal deleted inserted replaced
43327:ac33550f63e8 43328:416041f97cc3
389 389
390 # store sender and subject 390 # store sender and subject
391 sender = msg[r'From'] 391 sender = msg[r'From']
392 subject = msg[r'Subject'] 392 subject = msg[r'Subject']
393 if sender is not None: 393 if sender is not None:
394 sender = encoding.strtolocal(sender) 394 sender = mail.headdecode(sender)
395 if subject is not None: 395 if subject is not None:
396 subject = encoding.strtolocal(subject) 396 subject = mail.headdecode(subject)
397 del msg[r'From'], msg[r'Subject'] 397 del msg[r'From'], msg[r'Subject']
398 398
399 if not msg.is_multipart(): 399 if not msg.is_multipart():
400 # create fresh mime message from scratch 400 # create fresh mime message from scratch
401 # (multipart templates must take care of this themselves) 401 # (multipart templates must take care of this themselves)