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

Respect new strict parsing of email.utils.getaddresses #4023

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

petschki
Copy link
Member

@petschki petschki commented Oct 9, 2024

preferred solution for #4020 ... successor of #4021

@mister-roboto
Copy link

@petschki thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@petschki
Copy link
Member Author

petschki commented Oct 9, 2024

@jenkins-plone-org please run jobs

@petschki petschki force-pushed the getaddresses_strict_parsing_fix branch from 4504573 to ad95869 Compare October 9, 2024 07:14
@petschki
Copy link
Member Author

petschki commented Oct 9, 2024

@jenkins-plone-org please run jobs

Copy link
Sponsor Member

@mauritsvanrees mauritsvanrees left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. I have a few suggestions.
PloneTool.py has these methods:

  • validateEmailAddresses: validate a string with possibly multiple email addresses. For each address this calls validateSingleNormalizedEmailAddress.
  • validateSingleEmailAddress: validate a string with at most ONE email address. For this address this calls validateSingleNormalizedEmailAddress.
  • validateSingleNormalizedEmailAddress only needs to handle one address, obviously.
  • In all three methods: after checking if it is a string, can we do a .strip()?
  • In the two methods handling only a single address, can we do address.splitlines() and exit when this returns more than one line? In both cases this can replace the use of EMAIL_CUTOFF_RE.

BTW, I agree with your removing this line from the valid inputs:

 [email protected]\n [email protected]",  # omitting comma is ok

Products/CMFPlone/PloneTool.py Show resolved Hide resolved
@petschki
Copy link
Member Author

petschki commented Oct 9, 2024

BTW, I agree with your removing this line from the valid inputs:

 [email protected]\n [email protected]",  # omitting comma is ok

I first moved this line to the invalid inputs but then it fails on current py3.10 jenkins with no strict parsing.

@petschki
Copy link
Member Author

petschki commented Oct 9, 2024

@jenkins-plone-org please run jobs

@petschki
Copy link
Member Author

petschki commented Oct 9, 2024

Currently its hard to get a green jenkins ...

@petschki
Copy link
Member Author

@jenkins-plone-org please run jobs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants