You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
It seems that email.utils.formataddr and email.utils.parseaddr are not directly inverse from each other, because formataddr does not respect double spaces within the "realname" section.
For example:
from email.utils import formataddr, parseaddr
identity = '"foo bar" <foo@example.com>'
print(formataddr(parseaddr(identity)))
# 'foo bar <foo@example.com>'
print(formataddr(parseaddr(formataddr(parseaddr(identity)))))
# 'foo bar <foo@example.com>'
The first round trip strips the quotes, and the second round trip strips the double space in the "realname" section.
The utility function only seems to check for special characters, but it should also check for double spaces.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: