◐ Shell
reader mode source ↗
Skip to content

gh-102988: Detect email address parsing errors and return empty tuple to indicate the parsing error (old API)#102990

Closed
tdwyer wants to merge 2 commits into
python:mainfrom
tdwyer:issues102988
Closed

gh-102988: Detect email address parsing errors and return empty tuple to indicate the parsing error (old API)#102990
tdwyer wants to merge 2 commits into
python:mainfrom
tdwyer:issues102988

Conversation

@tdwyer

@tdwyer tdwyer commented Mar 24, 2023

Copy link
Copy Markdown
Contributor

Pull Request title

gh-102988: This PR is designed to detect parsing errors and return an empty tuple to indicate the parsing error. Additionally, this PR updates the test_email.py to check for these bugs, as well as, adds some other wacky Address Headers that are in the examples of RFC 2822 and makes sure they are being parsed correctly.

I realize that this PR dose not actually track down the bug and fix it. It simply detects the error has happened and returns a parsing error. However, Lib/email/utils.py is a much simple file than Lib/email/_parseaddr.py, so it is much easier to review this change. Additionally, there are actually multiple bugs which are causing erroneous output. Tracing the code flow for each and fixing them would be prone to error considering all of the wacky stuff that RFC 2822 allows for in Address headers. Finally, this change is actually rather simple.

@tdwyer tdwyer requested a review from a team as a code owner March 24, 2023 04:32
@bedevere-bot

Copy link
Copy Markdown

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@ghost

ghost commented Mar 24, 2023

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

@arhadthedev arhadthedev changed the title Detect parsing errors and return empty tuple to indicate the parsing error Mar 24, 2023
@bitdancer bitdancer changed the title gh-102988: Detect parsing errors and return empty tuple to indicate the parsing error Mar 24, 2023
@bedevere-bot

Copy link
Copy Markdown

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@gpshead gpshead left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

thanks for the PR!

@bedevere-bot

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@gpshead gpshead self-assigned this Apr 28, 2023
@gpshead gpshead requested a review from bitdancer April 28, 2023 21:53
@bedevere-bot

Copy link
Copy Markdown

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

1 similar comment
@bedevere-bot

Copy link
Copy Markdown

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@theta682 theta682 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

stylistic suggestions

12 hidden conversations Load more…
131 hidden items Load more…
@CharlieZhao95

Copy link
Copy Markdown
Contributor

You could use git merge, please see: https://devguide.python.org/getting-started/git-boot-camp/#updating-your-cpython-fork

Core developers can help to remove the redundant requests for review. Before that you may need to force push the correct commits, or close this PR and start a new one. :)

@bedevere-bot

Copy link
Copy Markdown

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@tdwyer

tdwyer commented May 31, 2023

Copy link
Copy Markdown
Contributor Author

I'm going to have to make a new PR... Git is all messed up now...

@tdwyer tdwyer closed this by deleting the head repository May 31, 2023
@tdwyer

tdwyer commented May 31, 2023

Copy link
Copy Markdown
Contributor Author

@gpshead @CharlieZhao95 @theta682 I had to create a new PR because I messed up Git when trying to push the changes #105127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting changes stdlib Standard Library Python modules in the Lib/ directory topic-email type-security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants