-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-30532: email.policy.SMTP.fold() mangles long headers #1892
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
Conversation
@jhillacre, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bitdancer, @serhiy-storchaka and @ezio-melotti to be potential reviewers. |
Lib/email/_header_value_parser.py
Outdated
@@ -343,7 +343,7 @@ def _fold(self, folded): | |||
if ws is not None: | |||
# Peel off the leading whitespace and make it sticky, to | |||
# avoid infinite recursion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! You could remove the repeated comment from line 340 while you are here.
Rebased from master so the windows build passes and gives the PR the ✔️. |
Is there anything I need to do to keep the PR moving? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small change, and we need a NEWS entry (which should now use the 'blurb' mechanism, see the recent updates to the devguide).
Lib/email/_header_value_parser.py
Outdated
# Peel off the leading whitespace and make it sticky, to | ||
# avoid infinite recursion. | ||
folded.stickyspace = str(part.pop(0)) | ||
folded.stickyspace = ws |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this was a case of me "fixing" the code, and missing one spot (for which there obviously wasn't a test). To make this code match other other instances of this logic, you should put an str call around ws.
@bitdancer, Added your requested changes in ec63c3c and 29f92f0. Should I be rebasing this pull request to a single commit with the message of |
Nope, it gets squashed during merge. Now it needs backport to 3.6, and I think 3.5 is still open for backports. You can do that (see devguide), or someone else will, since it isn't (yet) automated. |
Pull request for http://bugs.python.org/issue30532