diff options
author | James E. Blair <corvus@gnu.org> | 2009-07-27 21:24:01 -0700 |
---|---|---|
committer | James E. Blair <corvus@gnu.org> | 2009-07-27 21:24:01 -0700 |
commit | 27a1e2b02ad65f257a83110833dd11e6a2b13b58 (patch) | |
tree | b55a37caa03220a7797fb1f28d16219c537a4ad8 | |
parent | 1e68d73cdfd68ee441c2c952761305e3a122c487 (diff) |
Only URL quote urls if they aren't ASCII.
-rw-r--r-- | quoins/controllers.py | 5 |
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): |