summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <corvus@gnu.org>2009-07-27 21:24:01 -0700
committerJames E. Blair <corvus@gnu.org>2009-07-27 21:24:01 -0700
commit27a1e2b02ad65f257a83110833dd11e6a2b13b58 (patch)
treeb55a37caa03220a7797fb1f28d16219c537a4ad8
parent1e68d73cdfd68ee441c2c952761305e3a122c487 (diff)
Only URL quote urls if they aren't ASCII.
-rw-r--r--quoins/controllers.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/quoins/controllers.py b/quoins/controllers.py
index f627c61..1f9e971 100644
--- a/quoins/controllers.py
+++ b/quoins/controllers.py
@@ -328,7 +328,10 @@ class BlogController(TGController):
328 if obj is None: 328 if obj is None:
329 u = tg.url(self.path) 329 u = tg.url(self.path)
330 elif isinstance(obj, basestring): 330 elif isinstance(obj, basestring):
331 obj = urllib.quote(obj.encode('utf8')) 331 try:
332 obj.encode('ascii')
333 except:
334 obj = urllib.quote(obj.encode('utf8'))
332 if obj.startswith('/'): obj = obj[1:] 335 if obj.startswith('/'): obj = obj[1:]
333 u = tg.url(os.path.join(self.path, obj)) 336 u = tg.url(os.path.join(self.path, obj))
334 elif isinstance(obj, Post): 337 elif isinstance(obj, Post):