Matej Cepl 2023-08-11 20:15:40 +00:00 committed by Git OBS Bridge
parent 4a7548ec68
commit d30510674e

View File

@ -13,10 +13,11 @@ See https://github.com/python/cpython/issues/106669..
Co-authored-by: Gregory P. Smith <greg@krypto.org>
---
Doc/library/email.utils.rst | 24 ----------
Lib/email/test/test_email.py | 17 +++++++
Lib/email/test/test_email.py | 19 +++++++
Lib/email/test/test_email_renamed.py | 2
Lib/email/utils.py | 15 +-----
Misc/NEWS.d/next/Security/2023-06-13-20-52-24.gh-issue-102988.Kei7Vf.rst | 5 ++
4 files changed, 25 insertions(+), 36 deletions(-)
5 files changed, 27 insertions(+), 38 deletions(-)
create mode 100644 Misc/NEWS.d/next/Security/2023-06-13-20-52-24.gh-issue-102988.Kei7Vf.rst
--- a/Doc/library/email.utils.rst
@ -61,7 +62,7 @@ Co-authored-by: Gregory P. Smith <greg@krypto.org>
--- a/Lib/email/test/test_email.py
+++ b/Lib/email/test/test_email.py
@@ -2414,6 +2414,23 @@ Foo
@@ -2414,12 +2414,29 @@ Foo
[('Al Person', 'aperson@dom.ain'),
('Bud Person', 'bperson@dom.ain')])
@ -85,6 +86,24 @@ Co-authored-by: Gregory P. Smith <greg@krypto.org>
def test_getaddresses_nasty(self):
eq = self.assertEqual
eq(Utils.getaddresses(['foo: ;']), [('', '')])
eq(Utils.getaddresses(
['[]*-- =~$']),
- [('', ''), ('', ''), ('', '*--')])
+ [('', ''),])
eq(Utils.getaddresses(
['foo: ;', '"Jason R. Mastaler" <jason@dom.ain>']),
[('', ''), ('Jason R. Mastaler', 'jason@dom.ain')])
--- a/Lib/email/test/test_email_renamed.py
+++ b/Lib/email/test/test_email_renamed.py
@@ -2280,7 +2280,7 @@ Foo
eq(utils.getaddresses(['foo: ;']), [('', '')])
eq(utils.getaddresses(
['[]*-- =~$']),
- [('', ''), ('', ''), ('', '*--')])
+ [('', ''),])
eq(utils.getaddresses(
['foo: ;', '"Jason R. Mastaler" <jason@dom.ain>']),
[('', ''), ('Jason R. Mastaler', 'jason@dom.ain')])
--- a/Lib/email/utils.py
+++ b/Lib/email/utils.py
@@ -262,18 +262,9 @@ def parseaddr(addr):