From: MinRK Date: Thu, 2 Feb 2012 22:05:59 +0000 (-0800) Subject: coerce kwarg keys to str X-Git-Tag: v2.3.0~90^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F454%2Fhead;p=thirdparty%2Ftornado.git 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. --- diff --git a/tornado/web.py b/tornado/web.py index c31eb674b..a065d8bcb 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()]