﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
12989	URLValidator's verify_exists fails on IDN (Internationalized Domain Names)	Fraser Nevett	Jannis Leidel	"Changeset [12474] introduced validation for IDN values in URLs. However, the `verify_exists=True` functionality doesn't work when you try to verify an IDN exists...

{{{
>>> from django.core.validators import URLValidator
>>> url = u'http://עברית.idn.icann.org'
>>> URLValidator(url)
True
>>> URLValidator(url, verify_exists=True)
ValidationError
}}}

The problem seems to be that `urllib2` doesn't support IDN directly:

{{{
>>> req = urllib2.Request(url)
>>> urllib2.urlopen(req)
UnicodeEncodeError...
}}}

This can be resolved if the IDNA-encoded version is used instead:

{{{
idna_url = 'http://xn--54b7fta0cc.idn.icann.org/'
>>> req = urllib2.Request(idna_url)
>>> urllib2.urlopen(req)
<addinfourl at 3082877196L whose fp = <socket._fileobject object at 0xb7c1333c>>
}}}

ICANN has a [http://idn.icann.org/#The_example.test_names|list of example names] which might be useful for testing.

See also discussion at http://groups.google.com/group/django-developers/browse_frm/thread/6403db0c5229700a"		closed	Core (Other)	dev		fixed			Accepted	1	0	0	0	0	0
