#31053: EmailValidator should not accept soft hyphen in email addresses
-----------------------------------------+------------------------
               Reporter:  Mogoh Viol     |          Owner:  nobody
                   Type:  Bug            |         Status:  new
              Component:  Uncategorized  |        Version:  2.2
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
                  UI/UX:  0              |
-----------------------------------------+------------------------
 This emailaddress contains an invisible soft hyphen:
 test@example­example.com

 Djangos EmailValidator accepts that, but should not:
 {{{#!python
 from django.core import validators
 validators.validate_email('test@example­example.com')
 }}}

 Pythons formataddr does not accept it:

 {{{#!python
 from email.utils import formataddr
 formataddr(('','test@example­example.com'))
 }}}

 {{{
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/lib/python3.6/email/utils.py", line 91, in formataddr
     address.encode('ascii')
 UnicodeEncodeError: 'ascii' codec can't encode character '\xad' in
 position 12: ordinal not in range(128)
 }}}

 Djangos EmailValidator should not accept soft hyphens.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31053>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/048.629cad88f97534083e4ff4ac0fc6e7a5%40djangoproject.com.

Reply via email to