#31548: URLValidator is expected to raise ValidationError for empty string or 
not
string at all.
----------------------------------------------+------------------------
               Reporter:  Vasiliy Bondarenko  |          Owner:  nobody
                   Type:  Bug                 |         Status:  new
              Component:  Uncategorized       |        Version:  3.0
               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                   |
----------------------------------------------+------------------------
 URLValidator is expected to raise ValidationError for empty string,
 instead it fails on `.split` statement with general error:
 `AttributeError: 'NoneType' object has no attribute 'split'`
 or
 `AttributeError: 'int' object has no attribute 'split'`
 etc.


 in django/core/validators.py

 {{{


     def __call__(self, value):
         # Check first if the scheme is valid
         scheme = value.split('://')[0].lower()
         if scheme not in self.schemes:
             raise ValidationError(self.message, code=self.code)

 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31548>
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/061.0c1ea70781a8c97a0c6e20d80cdc4bb8%40djangoproject.com.

Reply via email to