Opened 17 years ago

Last modified 13 years ago

#4772 closed

urlresolver fails to resolve urls with unicode — at Initial Version

Reported by: alexthreed@… Owned by: Adrian Holovaty
Component: Core (Other) Version: dev
Severity: Keywords: unicode
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Traceback (most recent call last):
File "C:\python24\Lib\site-packages\django\template\init.py" in render_node

  1. result = node.render(context)

File "C:\python24\Lib\site-packages\django\template\defaulttags.py" in render

  1. nodelist.append(node.render(context))

File "C:\python24\Lib\site-packages\django\template\init.py" in render

  1. return self.filter_expression.resolve(context)

File "C:\python24\Lib\site-packages\django\template\init.py" in resolve

  1. obj = resolve_variable(self.var, context)

File "C:\python24\Lib\site-packages\django\template\init.py" in resolve_variable

  1. current = current()

File "C:\python24\Lib\site-packages\django\utils\functional.py" in _curried

  1. return _curried_func(*(args+moreargs), dict(kwargs, morekwargs))

File "C:\python24\Lib\site-packages\django\db\models\base.py" in get_absolute_url

  1. return settings.ABSOLUTE_URL_OVERRIDES.get('%s.%s' % (opts.app_label, opts.module_name), func)(self)

File "C:\python24\Lib\site-packages\django\db\models\init.py" in inner

  1. return reverse(bits[0], None, *bits[1:3])

File "C:\python24\lib\site-packages\django\core\urlresolvers.py" in reverse

  1. return iri_to_uri(u'/' + get_resolver(urlconf).reverse(viewname, *args, kwargs))

File "C:\python24\lib\site-packages\django\core\urlresolvers.py" in reverse

  1. return u.join([reverse_helper(part.regex, *args, kwargs) for part in self.reverse_dict[lookup_view]])

File "C:\python24\lib\site-packages\django\core\urlresolvers.py" in reverse_helper

  1. result = re.sub(r'\(([)]+)\)', MatchChecker(args, kwargs), regex.pattern)

File "C:\python24\lib\sre.py" in sub

  1. return _compile(pattern, 0).sub(repl, string, count)

File "C:\python24\lib\site-packages\django\core\urlresolvers.py" in call

  1. if not re.match(test_regex + '$', str(value)): # TODO: Unicode?

UnicodeEncodeError at /
'ascii' codec can't encode characters in position 0-7: ordinal not in range(128)

Change History (1)

by alexthreed@…, 17 years ago

Attachment: urlresolvers_unicode.patch added
Note: See TracTickets for help on using tickets.
Back to Top