mirror of
https://github.com/django/django.git
synced 2025-07-05 02:09:13 +00:00
unicode: Fixed #4367 -- Fixed a problem when trying to display some
legitimately non-unicode, non-UTF-8 data. The workaround is probably a bit broad, but it shouldn't hurt in any unintended way I can think of. git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5323 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
19d71a21df
commit
3989feed0c
@ -706,7 +706,12 @@ def resolve_variable(path, context):
|
|||||||
raise
|
raise
|
||||||
del bits[0]
|
del bits[0]
|
||||||
if isinstance(current, (basestring, Promise)):
|
if isinstance(current, (basestring, Promise)):
|
||||||
|
try:
|
||||||
current = force_unicode(current)
|
current = force_unicode(current)
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
# Failing to convert to unicode can happen sometimes (e.g. debug
|
||||||
|
# tracebacks). So we allow it in this particular instance.
|
||||||
|
pass
|
||||||
return current
|
return current
|
||||||
|
|
||||||
class Node(object):
|
class Node(object):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user