Author: carljm
Date: 2011-09-16 04:12:35 -0700 (Fri, 16 Sep 2011)
New Revision: 16838
Modified:
django/trunk/django/core/validators.py
Log:
Fixed #16812 -- Percent-encode URLs in verify_exists, to fix test failures on
Python 2.5 and 2.6.
Modified: django/trunk/django/core/validators.py
===================================================================
--- django/trunk/django/core/validators.py 2011-09-16 10:57:53 UTC (rev
16837)
+++ django/trunk/django/core/validators.py 2011-09-16 11:12:35 UTC (rev
16838)
@@ -1,5 +1,6 @@
import platform
import re
+import urllib
import urllib2
import urlparse
@@ -92,6 +93,8 @@
"User-Agent": self.user_agent,
}
url = url.encode('utf-8')
+ # Quote characters from the unreserved set, refs #16812
+ url = urllib.quote(url, "!*'();:@&=+$,/?#[]")
broken_error = ValidationError(
_(u'This URL appears to be a broken link.'),
code='invalid_link')
try:
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.