From 0b75124bb2e545b5d42c89a05fa87d1d616ecaed Mon Sep 17 00:00:00 2001 From: MinRK Date: Thu, 2 Feb 2012 14:05:59 -0800 Subject: [PATCH] coerce kwarg keys to str If handler regex is unicode, the keys of groupdict are unicode, but should be str, as Python < 2.6.5 does not accept unicode keys in: _execute(*args, **kwargs) Since they are for keyword args, they will be valid identifiers, and thus ascii. --- tornado/web.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tornado/web.py b/tornado/web.py index c31eb674..a065d8bc 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -1343,7 +1343,7 @@ class Application(object): if spec.regex.groupindex: kwargs = dict( - (k, unquote(v)) + (str(k), unquote(v)) for (k, v) in match.groupdict().iteritems()) else: args = [unquote(s) for s in match.groups()]