Author: mtredinnick
Date: 2007-10-20 03:38:59 -0500 (Sat, 20 Oct 2007)
New Revision: 6554
Modified:
django/trunk/django/utils/http.py
django/trunk/tests/regressiontests/text/tests.py
Log:
Fixed #5734 -- Fixed an omission where we weren't passing the "safe" argument
upstream in django.utils.http.urlquote(). Thanks, Thomas G?\195?\188ttler.
Modified: django/trunk/django/utils/http.py
===================================================================
--- django/trunk/django/utils/http.py 2007-10-20 08:31:05 UTC (rev 6553)
+++ django/trunk/django/utils/http.py 2007-10-20 08:38:59 UTC (rev 6554)
@@ -9,7 +9,8 @@
can safely be used as part of an argument to a subsequent iri_to_uri() call
without double-quoting occurring.
"""
- return force_unicode(urllib.quote(smart_str(url)))
+ return force_unicode(urllib.quote(smart_str(url), safe))
+
urlquote = allow_lazy(urlquote, unicode)
def urlquote_plus(url, safe=''):
Modified: django/trunk/tests/regressiontests/text/tests.py
===================================================================
--- django/trunk/tests/regressiontests/text/tests.py 2007-10-20 08:31:05 UTC
(rev 6553)
+++ django/trunk/tests/regressiontests/text/tests.py 2007-10-20 08:38:59 UTC
(rev 6554)
@@ -20,8 +20,12 @@
>>> from django.utils.http import urlquote, urlquote_plus
>>> urlquote(u'Paris & Orl\xe9ans')
u'Paris%20%26%20Orl%C3%A9ans'
+>>> urlquote(u'Paris & Orl\xe9ans', safe="&")
+u'Paris%20&%20Orl%C3%A9ans'
>>> urlquote_plus(u'Paris & Orl\xe9ans')
u'Paris+%26+Orl%C3%A9ans'
+>>> urlquote_plus(u'Paris & Orl\xe9ans', safe="&")
+u'Paris+&+Orl%C3%A9ans'
### iri_to_uri ###########################################################
>>> from django.utils.encoding import iri_to_uri
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---