Skip to content

Conversation

@encukou
Copy link
Member

@encukouencukou commented Sep 6, 2024

Detect email address parsing errors and return empty tuple to indicate the parsing error (old API). Add an optional 'strict' parameter to getaddresses() and parseaddr() functions. Patch by Thomas Dwyer.

Co-Authored-By: Thomas Dwyer [email protected]
(cherry picked from commit 4a153a1)


📚 Documentation preview 📚: https://cpython-previews--123766.org.readthedocs.build/

…n email.parseaddr() (pythonGH-111116) Detect email address parsing errors and return empty tuple to indicate the parsing error (old API). Add an optional 'strict' parameter to getaddresses() and parseaddr() functions. Patch by Thomas Dwyer. Co-Authored-By: Thomas Dwyer <[email protected]> (cherry picked from commit 4a153a1)
@encukouencukou requested a review from a team as a code ownerSeptember 6, 2024 09:45
@bedevere-appbedevere-appbot added type-bug An unexpected behavior, bug, or error type-security A security issue labels Sep 6, 2024
@ambvambv merged commit 1506824 into python:3.12Sep 6, 2024
miketheman added a commit to miketheman/warehouse that referenced this pull request Sep 12, 2024
Now that Python validates the addresses more strictly, we won't hit the condition any longer. If we wish to preserve this condition, we could also pass `strict=False` to `getaddresses()`, but that seems to be counter to our desire of having a valid email address. Refs: python/cpython#123766 Signed-off-by: Mike Fiedler <[email protected]>
ewdurbin pushed a commit to pypi/warehouse that referenced this pull request Sep 13, 2024
* chore: update Python 3.12.6 Refs: https://www.python.org/downloads/release/python-3126/ Signed-off-by: Mike Fiedler <[email protected]> * chore: remove unreachable condition Now that Python validates the addresses more strictly, we won't hit the condition any longer. If we wish to preserve this condition, we could also pass `strict=False` to `getaddresses()`, but that seems to be counter to our desire of having a valid email address. Refs: python/cpython#123766 Signed-off-by: Mike Fiedler <[email protected]> * test: refactor test case to parametrize Extract test cases from inline to make it clearer which permutations are being tested. Signed-off-by: Mike Fiedler <[email protected]> --------- Signed-off-by: Mike Fiedler <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bugAn unexpected behavior, bug, or errortype-securityA security issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@encukou@ambv@vstinner