Django

Code

Changeset 5636

Show
Ignore:
Timestamp:
07/08/07 06:22:53 (1 year ago)
Author:
mtredinnick
Message:

Fixed #4798-- Made sure that function keyword arguments are strings (for the
keywords themselves) when using Unicode URL patterns.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/urlresolvers.py

    r5632 r5636  
    1010from django.http import Http404 
    1111from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist 
    12 from django.utils.encoding import iri_to_uri, force_unicode 
     12from django.utils.encoding import iri_to_uri, force_unicode, smart_str 
    1313from django.utils.functional import memoize 
    1414import re 
     
    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}