]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-38698: Prevent UnboundLocalError to pop up in parse_message_id (GH-17277)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 5 Dec 2019 17:42:01 +0000 (09:42 -0800)
committerGitHub <noreply@github.com>
Thu, 5 Dec 2019 17:42:01 +0000 (09:42 -0800)
commite21aa61e96f8343200e765d119ebe778873a6bf1
treeb5349053ac33a268b72c02e802bf5d9032e93fda
parentcfdaf92221da3c264d0da9c588994fefe4073196
bpo-38698: Prevent UnboundLocalError to pop up in parse_message_id (GH-17277)

parse_message_id() was improperly using a token defined inside an exception
handler, which was raising `UnboundLocalError` on parsing an invalid value.

https://bugs.python.org/issue38698
(cherry picked from commit bb815499af855b1759c02535f8d7a9d0358e74e8)

Co-authored-by: Claudiu Popa <pcmanticore@gmail.com>
Lib/email/_header_value_parser.py
Lib/test/test_email/test__header_value_parser.py
Misc/NEWS.d/next/Library/2019-12-02-10-35-19.bpo-38698.WZnAPQ.rst [new file with mode: 0644]