gh-155917: Narrow bare except in email._header_value_parser.get_parameter (gh-155916)

corona10 <[email protected]>
Newsgroups gmane.comp.python.cvs
Message-ID <[email protected]>
https://github.com/python/cpython/commit/e3910521029a04b7ec4432fdbdc01458fb7fc863
commit: e3910521029a04b7ec4432fdbdc01458fb7fc863
branch: main
author: cmw0213 <[email protected]>
committer: corona10 <[email protected]>
date: 2026-08-17T04:13:08Z
summary:

gh-155917: Narrow bare except in email._header_value_parser.get_parameter (gh-155916)

files:
M Lib/email/_header_value_parser.py

diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py
index 792072ab9f6128a..7c03fb49b3b5e77 100644
--- a/Lib/email/_header_value_parser.py
+++ b/Lib/email/_header_value_parser.py
@@ -2537,7 +2537,7 @@ def get_parameter(value):
         else:
             try:
                 token, rest = get_extended_attrtext(inner_value)
-            except:
+            except errors.HeaderParseError:
                 pass
             else:
                 if not rest:

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.