Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect parsing errors and return empty tuple to indicate the parsing error #102989

Closed
wants to merge 1 commit into from
Closed

Detect parsing errors and return empty tuple to indicate the parsing error #102989

wants to merge 1 commit into from

Conversation

tdwyer
Copy link
Contributor

@tdwyer tdwyer commented Mar 24, 2023

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:07
@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

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

@cpython-cla-bot
Copy link

cpython-cla-bot bot commented Mar 24, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@tdwyer
Copy link
Contributor Author

tdwyer commented Mar 24, 2023

Need to make new PR with email address used on github

@tdwyer tdwyer closed this Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants