Opened 10 years ago

Closed 10 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

Description

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

>>> from django.core.validators import URLValidator
>>> validator = URLValidator()
>>> validator('http://user:password@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

Change History (1)

comment:1 by Aymeric Augustin, 10 years ago

Resolution: duplicate
Status: newclosed

This appears to be a duplicate of #20003.

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