[Django] #23985: URLValidator optional schemes causes backward incompatible changes

5 views
Skip to first unread message

Django

unread,
Dec 12, 2014, 9:18:36 AM12/12/14
to django-...@googlegroups.com
#23985: URLValidator optional schemes causes backward incompatible changes
-------------------------------+--------------------
Reporter: bruno.devpod | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
For people who were using custom regex to restrict uri schemes this new
optional feature causes a backwards incompatible change, because any
scheme not listed in schemes param will not be validated, even if the
regex matches the given url.

It would be nice to have a note in the backward incompatible changes
documentation of Django 1.7.

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

Django

unread,
Dec 12, 2014, 10:47:43 AM12/12/14
to django-...@googlegroups.com
#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

unread,
Jul 23, 2015, 1:23:01 PM7/23/15
to django-...@googlegroups.com
#23985: URLValidator optional schemes causes backward incompatible changes
--------------------------------------+------------------------------------
Reporter: bruno.devpod | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | 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 timgraham):

* component: Core (Other) => Documentation


--
Ticket URL: <https://code.djangoproject.com/ticket/23985#comment:2>

Django

unread,
Oct 29, 2015, 5:06:39 PM10/29/15
to django-...@googlegroups.com
#23985: URLValidator optional schemes causes backward incompatible changes
--------------------------------------+------------------------------------
Reporter: bruno.devpod | Owner: nobody

Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/5508 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/23985#comment:3>

Django

unread,
Oct 29, 2015, 5:29:53 PM10/29/15
to django-...@googlegroups.com
#23985: URLValidator optional schemes causes backward incompatible changes
-------------------------------------+-------------------------------------
Reporter: bruno.devpod | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by claudep):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/23985#comment:4>

Django

unread,
Oct 29, 2015, 6:06:58 PM10/29/15
to django-...@googlegroups.com
#23985: URLValidator optional schemes causes backward incompatible changes
-------------------------------------+-------------------------------------
Reporter: bruno.devpod | Owner: nobody
Type: | Status: closed

Cleanup/optimization |
Component: Documentation | Version: 1.7
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"8c5b8018f69226389a1373523c41cd37883c9556" 8c5b8018]:
{{{
#!CommitTicketReference repository=""
revision="8c5b8018f69226389a1373523c41cd37883c9556"
Fixed #23985 -- Documented a backwards incompatible change in
URLValidator.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23985#comment:5>

Django

unread,
Oct 29, 2015, 6:07:23 PM10/29/15
to django-...@googlegroups.com
#23985: URLValidator optional schemes causes backward incompatible changes
-------------------------------------+-------------------------------------
Reporter: bruno.devpod | Owner: nobody

Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 1.7
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"e20a27b52b0f02480255e7af16d877d079f4fe2b" e20a27b]:
{{{
#!CommitTicketReference repository=""
revision="e20a27b52b0f02480255e7af16d877d079f4fe2b"
[1.8.x] Fixed #23985 -- Documented a backwards incompatible change in
URLValidator.

Backport of 8c5b8018f69226389a1373523c41cd37883c9556 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23985#comment:6>

Django

unread,
Oct 29, 2015, 6:07:28 PM10/29/15
to django-...@googlegroups.com
#23985: URLValidator optional schemes causes backward incompatible changes
-------------------------------------+-------------------------------------
Reporter: bruno.devpod | Owner: nobody

Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 1.7
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"83607e2b7ad8e20a5ad4892b711f7a83aeea073e" 83607e2b]:
{{{
#!CommitTicketReference repository=""
revision="83607e2b7ad8e20a5ad4892b711f7a83aeea073e"
[1.9.x] Fixed #23985 -- Documented a backwards incompatible change in
URLValidator.

Backport of 8c5b8018f69226389a1373523c41cd37883c9556 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23985#comment:8>

Django

unread,
Oct 29, 2015, 6:07:29 PM10/29/15
to django-...@googlegroups.com
#23985: URLValidator optional schemes causes backward incompatible changes
-------------------------------------+-------------------------------------
Reporter: bruno.devpod | Owner: nobody

Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 1.7
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"85a41b449bfe40307d1a9c482fc39dd1f82ba470" 85a41b4]:
{{{
#!CommitTicketReference repository=""
revision="85a41b449bfe40307d1a9c482fc39dd1f82ba470"
[1.7.x] Fixed #23985 -- Documented a backwards incompatible change in
URLValidator.

Backport of 8c5b8018f69226389a1373523c41cd37883c9556 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23985#comment:7>

Reply all
Reply to author
Forward
0 new messages