                  original = value
                  value = smart_unicode(value)
                  splitted = urlparse.urlsplit(value)
                  try:
                      netloc_ace = splitted[1].encode('idna') # IDN -> ACE
                  except UnicodeError: # invalid domain part
                      raise e
                  value = value.replace(splitted[1], netloc_ace)
                  # If no URL path given, assume /
                  if not splitted[2]:
 
</s> remove                 value = value.replace(splitted[1], netloc_ace)
                # If no URL path given, assume /
                if not splitted[2]:
                    value += u'/'
                super(URLValidator, self).__call__(value)
                # After validation revert ACE encoded domain-part to
                # original (IDN) value as suggested by RFC 3490
                value = original
 </s> add                 url = urlparse.urlunsplit((scheme, netloc, path, query, fragment))
                super(URLValidator, self).__call__(url) </s> remove                 splitted = urlparse.urlsplit(value)
 </s> add                 scheme, netloc, path, query, fragment = urlparse.urlsplit(value) </s> remove                 original = value
 </s> add  </s> remove                 req = urllib2.Request(value, None, headers)
 </s> add                 req = urllib2.Request(url, None, headers)
                    netloc = netloc.encode('idna') # IDN -> ACE
                  original = value
                  value = smart_unicode(value)
                  splitted = urlparse.urlsplit(value)
                  try:
                    netloc = netloc.encode('idna') # IDN -> ACE
                  except UnicodeError: # invalid domain part
                      raise e
                  value = value.replace(splitted[1], netloc_ace)
                  # If no URL path given, assume /
                  if not splitted[2]:
keep keep keep keep replace keep keep keep keep keep
 Fixed #12989 - Fixed verification of IDN URLs. Thanks to Fraser Nevett for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12620 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/core/validators.py