Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.2.X] Fixed #14941 -- Stop raising ValidationError in form fields t…

…hat use the URLValidator and get a IDN domain passed. Thanks, Claude Paroz.

Backport from trunk (r15504).

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 748110cb94352fc0a796dec0d559f4c6a5a797c2 1 parent 89c03dc
@jezdez jezdez authored
2  django/core/
@@ -81,7 +81,7 @@ def __call__(self, value):
"User-Agent": self.user_agent,
- req = urllib2.Request(url, None, headers)
+ req = urllib2.Request(url.encode('utf-8'), None, headers)
u = urllib2.urlopen(req)
except ValueError:
raise ValidationError(_(u'Enter a valid URL.'), code='invalid')
2  tests/regressiontests/forms/tests/
@@ -567,6 +567,8 @@ def test_urlfield_3(self):
f.clean('') # good domain, bad page
except ValidationError, e:
self.assertEqual("[u'This URL appears to be a broken link.']", str(e))
+ # UTF-8 char in path
+ self.assertEqual(u'\xfcr', f.clean(u'\xfcr'))
def test_urlfield_4(self):
f = URLField(verify_exists=True, required=False)
Please sign in to comment.
Something went wrong with that request. Please try again.