Bug report
Bug description:
Documented behaviour: The getaddresses docstring states: "Return a list of (REALNAME, EMAIL) or ('','') for each fieldvalue." It further states: "If strict is true, use a strict parser which rejects malformed inputs." RFC 2822 comments permit commas; such a comment does not make a mailbox malformed or introduce another address.
Expected: Exactly one tuple with email component 'alice@example.com'.
Actual: [('', '')]
import email.utils
import re
field = "alice@example.com" + " (team, west)"
# This RFC 2822 subset has a dot-atom addr-spec and balanced ASCII comment.
m = re.fullmatch(r"([A-Za-z]+(?:\.[A-Za-z]+)*@[A-Za-z]+(?:\.[A-Za-z]+)+) \(([A-Za-z ,]*)\)", field)
if not m:
print("REFUTATION REJECTED: input not independently validated")
else:
expected = [(m[2], m[1])]
try:
actual = email.utils.getaddresses([field], strict=True)
except Exception as e:
print("REFUTATION REJECTED:", type(e).__name__, str(e))
else:
if len(actual) != 1 or actual[0][1] != m[1]:
print("REFUTATION CONFIRMED:", repr(field), actual, expected)
else:
print("REFUTATION REJECTED: one address with the expected addr-spec")
Output on Python 3.14.6 (Windows-11-10.0.26220-SP0), standard library email.utils:
REFUTATION CONFIRMED: 'alice@example.com (team, west)' [('', '')] [('team, west', 'alice@example.com')]
This report was found and written by an automated property-testing tool I run (bugforge). The reproducer above was executed and its output is pasted unedited; no person reviewed the report before it was filed. The search script is in https://github.com/augusto-rehfeldt/bugforge-results/tree/main/email.utils-20261003-060025-c4
CPython versions tested on:
3.14
Operating systems tested on:
Windows
Bug report
Bug description:
Documented behaviour: The getaddresses docstring states: "Return a list of (REALNAME, EMAIL) or ('','') for each fieldvalue." It further states: "If strict is true, use a strict parser which rejects malformed inputs." RFC 2822 comments permit commas; such a comment does not make a mailbox malformed or introduce another address.
Expected: Exactly one tuple with email component 'alice@example.com'.
Actual: [('', '')]
Output on Python 3.14.6 (Windows-11-10.0.26220-SP0), standard library
email.utils:This report was found and written by an automated property-testing tool I run (bugforge). The reproducer above was executed and its output is pasted unedited; no person reviewed the report before it was filed. The search script is in https://github.com/augusto-rehfeldt/bugforge-results/tree/main/email.utils-20261003-060025-c4
CPython versions tested on:
3.14
Operating systems tested on:
Windows