[Django] #21532: Django URLValidator fails on some valid URLs

3 views
Skip to first unread message

Django

unread,
Nov 29, 2013, 11:39:17 AM11/29/13
to django-...@googlegroups.com
#21532: Django URLValidator fails on some valid URLs
-----------------------------+-------------------------------
Reporter: dbrgn | Owner: nobody
Type: Bug | Status: new
Component: Core (URLs) | Version: 1.6
Severity: Normal | Keywords: validation, regex
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+-------------------------------
This raises a ValidationError, even though the URL is valid:

{{{
#!python
>>> from django.core.validators import URLValidator
>>> validator = URLValidator()
>>> validator('http://user:pass...@1.2.3.4:80/')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/danilo/.virtualenvs/test/lib/python2.7/site-
packages/django/core/validators.py", line 66, in __call__
super(URLValidator, self).__call__(url)
File "/home/danilo/.virtualenvs/test/lib/python2.7/site-
packages/django/core/validators.py", line 39, in __call__
raise ValidationError(self.message, code=self.code)
django.core.exceptions.ValidationError
}}}

Maybe we need to go over the RegEx used? This could be used for testing:
http://mathiasbynens.be/demo/url-regex

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

Django

unread,
Nov 29, 2013, 11:48:58 AM11/29/13
to django-...@googlegroups.com
#21532: Django URLValidator fails on some valid URLs
-----------------------------------+--------------------------------------
Reporter: dbrgn | Owner: nobody
Type: Bug | Status: closed

Component: Core (URLs) | Version: 1.6
Severity: Normal | Resolution: duplicate

Keywords: validation, regex | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* status: new => closed
* needs_better_patch: => 0
* resolution: => duplicate
* needs_tests: => 0
* needs_docs: => 0


Comment:

This appears to be a duplicate of #20003.

--
Ticket URL: <https://code.djangoproject.com/ticket/21532#comment:1>

Reply all
Reply to author
Forward
0 new messages