Skip to content

Commit 5a32b3a

Browse files
committed
Fixed #4798-- Made sure that function keyword arguments are strings (for the
keywords themselves) when using Unicode URL patterns. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5636 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent b6812f2 commit 5a32b3a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

django/core/urlresolvers.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from django.http import Http404
1111
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
12-
from django.utils.encoding import iri_to_uri, force_unicode
12+
from django.utils.encoding import iri_to_uri, force_unicode, smart_str
1313
from django.utils.functional import memoize
1414
import re
1515

@@ -229,8 +229,10 @@ def resolve(self, path):
229229
tried.extend([(pattern.regex.pattern + ' ' + t) for t in e.args[0]['tried']])
230230
else:
231231
if sub_match:
232-
sub_match_dict = dict(self.default_kwargs, **sub_match[2])
233-
return sub_match[0], sub_match[1], dict(match.groupdict(), **sub_match_dict)
232+
sub_match_dict = dict([(smart_str(k), v) for k, v in match.groupdict().items()])
233+
sub_match_dict.update(self.default_kwargs)
234+
sub_match_dict.update([(smart_str(k), v) for k, v in sub_match[2].items()])
235+
return sub_match[0], sub_match[1], sub_match_dict
234236
tried.append(pattern.regex.pattern)
235237
raise Resolver404, {'tried': tried, 'path': new_path}
236238

0 commit comments

Comments
 (0)