# HG changeset patch # User Denis Laxalde # Date 1571920284 -7200 # Node ID 866bd2cf764b58f706e91c117b11e6ffb3ff8cbb # Parent 84c15836a2d72f5d3f81eab15361b9d371088f63 mail: catch LookupError in headdecode() We already catch this exception in _encode() (called by headencode()). It gets raised when running test-notify.t with Python 3. diff -r 84c15836a2d7 -r 866bd2cf764b mercurial/mail.py --- a/mercurial/mail.py Thu Oct 24 16:56:36 2019 +0200 +++ b/mercurial/mail.py Thu Oct 24 14:31:24 2019 +0200 @@ -458,7 +458,7 @@ try: uparts.append(part.decode(charset)) continue - except UnicodeDecodeError: + except (UnicodeDecodeError, LookupError): pass # On Python 3, decode_header() may return either bytes or unicode # depending on whether the header has =?? or not