Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 5a32b3ac2c99a1f3e033dd3af1b20e309ccea8ad 1 parent b6812f2
Malcolm Tredinnick malcolmt authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 django/core/urlresolvers.py
8 django/core/urlresolvers.py
View
@@ -9,7 +9,7 @@
from django.http import Http404
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
-from django.utils.encoding import iri_to_uri, force_unicode
+from django.utils.encoding import iri_to_uri, force_unicode, smart_str
from django.utils.functional import memoize
import re
@@ -229,8 +229,10 @@ def resolve(self, path):
tried.extend([(pattern.regex.pattern + ' ' + t) for t in e.args[0]['tried']])
else:
if sub_match:
- sub_match_dict = dict(self.default_kwargs, **sub_match[2])
- return sub_match[0], sub_match[1], dict(match.groupdict(), **sub_match_dict)
+ sub_match_dict = dict([(smart_str(k), v) for k, v in match.groupdict().items()])
+ sub_match_dict.update(self.default_kwargs)
+ sub_match_dict.update([(smart_str(k), v) for k, v in sub_match[2].items()])
+ return sub_match[0], sub_match[1], sub_match_dict
tried.append(pattern.regex.pattern)
raise Resolver404, {'tried': tried, 'path': new_path}
Please sign in to comment.
Something went wrong with that request. Please try again.