]> git.ozlabs.org Git - patchwork/commit
filters: handle utf-8 characters when building filter querystring
authorJeremy Kerr <jk@ozlabs.org>
Thu, 8 Dec 2011 13:42:26 +0000 (21:42 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 8 Dec 2011 13:45:22 +0000 (21:45 +0800)
commita45a3fdfdb9706791ff36128399b302c4fa37c52
treeb10456566934f66081b56177b80e2c56d889ac3d
parentfa999187bfc23bc0d674875c554c360601f8f6b4
filters: handle utf-8 characters when building filter querystring

Currently, we build the filter querystring by passing the raw string to
urllib.quote, which expects an encoded string. When the raw string (in
this case, a unicode object) contains a unicode character, quote()
raises a KeyError.

This fixes the problem by encoding the parameter name and values to
UTF-8 first.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/patchwork/filters.py
apps/patchwork/tests/filters.py