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
Don't rely on the IDNA library for checking valid hyphens, use our own checks
Including invalid RFC 5890 R-LDH labels (e.g. '??--' other than 'xn--'), see #92.
The IDNA library will check this but its error messages are not friendly, and for future proofing it's better to not assume it does any general syntax checks.
raiseEmailSyntaxError("An email address cannot have two letters followed by two dashes immediately after the @-sign or after a period, except Punycode.")
('my.λong.address@1111111111222222222233333333334444444444555555555.6666666666777777777788888888889999999999000000000.1111111111222222222233333333334444444444555555555.6666666666777777777788888888889999999999000000000.1111111111222222222233333333334444.info', 'The email address is too long (at least 1 character too many).'),
248
254
('me@bad-tld-1', 'The part after the @-sign is not valid. It should have a period.'),
249
255
('me@bad.tld-2', 'The part after the @-sign is not valid. It is not within a valid top-level domain.'),
250
-
('me@-', 'The part after the @-sign contains invalid characters (Label must not start or end with a hyphen).'),
251
256
('me@x!', 'The part after the @-sign contains invalid characters (Codepoint U+0021 at position 2 of \'x!\' not allowed).'),
252
-
('me@xn--', 'The part after the @-sign contains invalid characters (Malformed A-label, no Punycode eligible content found).'),
253
-
('me@yy--', 'The part after the @-sign contains invalid characters (Label has disallowed hyphens in 3rd and 4th position).'),
257
+
('me@xn--0.tld', 'The part after the @-sign is not valid IDNA (Invalid A-label).'),
258
+
('me@yy--0.tld', 'An email address cannot have two letters followed by two dashes immediately after the @-sign or after a period, except Punycode.'),
259
+
('me@yy--0.tld', 'An email address cannot have two letters followed by two dashes immediately after the @-sign or after a period, except Punycode.'),
0 commit comments