[3.14] gh-148518 fix index error in local part attribute (GH-148522) (#149200)
As part of fixing bpo-27931 code was introduced to get_bare_quoted_string that added an empty Terminal if the quoted string was empty. This isn't the best answer in terms of the parse tree; we really want the token list to be empty in that case. But having it be empty resulted in local_part raising the index error. We find that same problem if we try to parse an address consisting of a single dquote. By fixing local_part to not raise on an empty token list, we can have the bare_quoted_string code correctly return an empty token list for the empty string cases (two dquotes or a single dquote as the entire addrespec, at the end of a line). (cherry picked from commit bdbb55c403d2ab6b4b0a3e994d21b623fee4a544) Co-authored-by: R. David Murray <rdmurray@bitdance.com>
M
Miss Islington (bot) committed
79f39c93b0060402c464f8c90613c865244634e8
Parent: f23837d
Committed by GitHub <noreply@github.com>
on 4/30/2026, 10:13:52 PM