-
Notifications
You must be signed in to change notification settings - Fork 17
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
refactor: use EmailMessage class #142
Conversation
Will need to see if we have anyone using this API, so we know if we need back compat. |
I don't see anyone doing more than |
e7f2f1f
to
c0b5af7
Compare
df9a944
to
a23541b
Compare
Here's the 30 usages I could find: (Quite a few are actually forks or copies that GitHub doesn't know are forks) I think dropping |
def items(self) -> list[tuple[str, str]]: | ||
return self._headers.copy() | ||
If a value is None, do nothing. | ||
If a value contains a newline, indent it (may produce a warning in the future). |
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.
Uh? Do we actually need this? Why? Does this even work with EmailMesage
? I would not be surprised if it normalized whitespace in headers or encode it somehow. Anyhow, how do multi-line strings end up here?
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.
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.
(Note that in #2, the extended mechanism is only for the description, which is now in the body instead, and the actual mechanism included pipe chars).
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.
(and in scikit-build-core I manually disallow multiline summaries)
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.
And you can actually read these multiline strings with email.parse
, I did check it, it keeps the indention. Without indentation, they don't work, of course.
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.
I pulled out and merged the preparation steps, so you can see just the move by itself.
pre-commit.ci autofix |
Signed-off-by: Henry Schreiner <[email protected]>
5e4386e
to
cdc3839
Compare
Make
RFC822
a subclass ofEmailMessage
and remove all reliance on custom behaviors.Close #101.