                  "Connection": "close",
                  "User-Agent": self.user_agent,
              }
              try:
                  req = urllib2.Request(value, None, headers)
                  u = urllib2.urlopen(req)
              except ValueError:
                  raise ValidationError(_(u'Enter a valid URL.'), code='invalid')
              except: # urllib2.URLError, httplib.InvalidURL, etc.
                  raise ValidationError(_(u'This URL appears to be a broken link.'), code='invalid_link')
 
</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                     netloc_ace = splitted[1].encode('idna') # IDN -> ACE
 </s> add                     netloc = netloc.encode('idna') # IDN -> ACE </s> remove                 splitted = urlparse.urlsplit(value)
 </s> add                 scheme, netloc, path, query, fragment = urlparse.urlsplit(value) </s> remove                 original = value
 </s> add 
                req = urllib2.Request(url, None, headers)
                  "Connection": "close",
                  "User-Agent": self.user_agent,
              }
              try:
                req = urllib2.Request(url, None, headers)
                  u = urllib2.urlopen(req)
              except ValueError:
                  raise ValidationError(_(u'Enter a valid URL.'), code='invalid')
              except: # urllib2.URLError, httplib.InvalidURL, etc.
                  raise ValidationError(_(u'This URL appears to be a broken link.'), code='invalid_link')
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