Repository navigation
gh-161966: Fix UnboundLocalError in email._header_value_parser for a domain literal starting with whitespace - #161967
Conversation
…for a domain literal starting with whitespace
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Gentle ping: @bitdancer, would you have time to take a look? It's a small guard in |
|
Don't worry about gh-152710, I'm going to have to redo that from scratch in smaller pieces anyway. I'll close it when I get started on that. |
|
Thanks @Broyojo for the PR, and @bitdancer for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Thanks @Broyojo for the PR, and @bitdancer for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
GH-162907 is a backport of this pull request to the 3.14 branch. |
|
GH-162908 is a backport of this pull request to the 3.15 branch. |
_get_ptext_to_endcharsreadposbefore assigning it when its input started with whitespace, because the first word from_wsp_splitterwas then empty and the loop body never ran. This could happen when aMessage-ID,ReferencesorIn-Reply-Toheader has a domain literal such as<a@[ x]>. Theif not valueguard added for gh-134152 is replaced by a check on the empty first word, which covers both cases. The header now parses the same way as<a@[x ]>, as an obsolete id-right with anObsoleteHeaderDefect.Note: the open refactor in gh-152710 edits the same lines, so whichever merges second will need a small rebase.