Opened 5 years ago

Closed 5 years ago

#21532 closed Bug (duplicate)

Django URLValidator fails on some valid URLs

Reported by: Danilo Bargen Owned by: nobody
Component: Core (URLs) Version: 1.6
Severity: Normal Keywords: validation, regex
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


This raises a ValidationError, even though the URL is valid:

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

Maybe we need to go over the RegEx used? This could be used for testing:

Change History (1)

comment:1 Changed 5 years ago by Aymeric Augustin

Resolution: duplicate
Status: newclosed

This appears to be a duplicate of #20003.

Note: See TracTickets for help on using tickets.
Back to Top