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.
This commit is contained in:
MinRK 2012-02-02 14:05:59 -08:00
parent ffc9b3d4e3
commit 0b75124bb2
1 changed files with 1 additions and 1 deletions

View File

@ -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()]