#23985: URLValidator optional schemes causes backward incompatible changes
--------------------------------------+------------------------------------
     Reporter:  bruno.devpod          |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Core (Other)          |                  Version:  1.7
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by bmispelon):

 * needs_better_patch:   => 0
 * component:  Uncategorized => Core (Other)
 * needs_tests:   => 0
 * needs_docs:   => 0
 * type:  Uncategorized => Cleanup/optimization
 * stage:  Unreviewed => Accepted


Comment:

 Hi,

 I'm not sure what the benefit of using a `URLValidator` over a plain
 `Regexvalidator` is if you're using a custom `regex` but still, I think
 you're right.

 The following (simplified) code would pass under Django 1.6 but raises a
 `ValidationError` under 1.7:
 {{{#!python
 from django.core.validators import URLValidator

 URLValidator(regex='.')('irc://irc.freenode.net/django')
 }}}

 I wonder if there's a way to fix the backwards-compatibility issue rather
 than documenting it (maybe by disabling `schemes` if a custom `regex` has
 been given but that might not be feasible in practice).
 If we can't fix the issue, then we should certainly document it.

 Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/23985#comment:1>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.2906121e94f8ac30c0add9937177f69a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to