From 86946fde64505c55424eed4cf891b8c4a98cefd3 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Thu, 7 Nov 2013 01:09:41 -0600 Subject: support encoding arbitrary query strings --- pyramid/url.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pyramid/url.py b/pyramid/url.py index fda2c72c7..2e3542161 100644 --- a/pyramid/url.py +++ b/pyramid/url.py @@ -222,7 +222,9 @@ class URLMethodsMixin(object): if '_query' in kw: query = kw.pop('_query') - if query: + if isinstance(query, text_type): + qs = '?' + native_(query) + elif query: qs = '?' + urlencode(query, doseq=True) if '_anchor' in kw: @@ -580,7 +582,9 @@ class URLMethodsMixin(object): if 'query' in kw: query = kw['query'] - if query: + if isinstance(query, text_type): + qs = '?' + native_(query) + elif query: qs = '?' + urlencode(query, doseq=True) if 'anchor' in kw: -- cgit v1.2.3