[twill] query_string handling in wsgi_intercept.py

Takashi Matsuo tmatsuo at shehas.net
Tue Apr 15 17:36:14 PDT 2008


Hello list,

I got myselft to start writing test code for my turbogear-1.x project
with twill. So, I use wsgi_intercept.add_wsgi_intercept() in my
testcase. It worked well except for the query_string value.

In make_environ function in the file wsgi_intercept.py, query_string
is decoded and stored as environ, but in my opinion, it shouldn't be
decoded in this stage. Actually, decoding the query_string in this
stage breaks encoded plus value (%2B)  in the query string of the URL
because my app will decode this value once again, and treat it as just
a space.

In short, query string is decoded twice like following
%2B -> + -> SPACE

Please look into the attached file. This change doesn't break the
twill's unittest at all.

Regards,

-- Takashi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: twill-query_string.diff
Type: text/x-diff
Size: 599 bytes
Desc: not available
Url : http://lists.idyll.org/pipermail/twill/attachments/20080416/3a885e09/attachment.diff 


More information about the twill mailing list