Skip to content
Browse files

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: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 19d71a2 commit 3989feed0c79544aba298e4c9ce77d7562268557 @malcolmt malcolmt committed
Showing with 6 additions and 1 deletion.
  1. +6 −1 django/template/
7 django/template/
@@ -706,7 +706,12 @@ def resolve_variable(path, context):
del bits[0]
if isinstance(current, (basestring, Promise)):
- current = force_unicode(current)
+ try:
+ 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
class Node(object):

0 comments on commit 3989fee

Please sign in to comment.
Something went wrong with that request. Please try again.