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.Dismiss alert
{{ message }}
Repository navigation
email() rejects escaped characters in quoted local parts #580
RFC 5322 section 3.2.1 defines a quoted-pair as a backslash followed by any VCHAR or WSP, so "a\"b"@example.com and "a\\b"@example.com are valid addresses.
This seems to come from af69a68 ("patch: supported extended latin in username"), which changed the quoted-pair part of the regex from \\[\001-\011\013\014\016-\177] to \\[\011.]. Inside a character class . only matches a literal dot, so only \. and an escaped tab are accepted now. Before that commit, "a\"b"@example.com validated as True.
If the narrower rule was intentional, please let me know. Otherwise I'd like to open a PR that accepts a backslash followed by a tab or any printable ASCII character, while still rejecting escaped control characters (so the existing "\<LF>" test still fails as expected).
Reproduced on master (22786cc), Python 3.14 on Windows.
Activity