Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit 3989feed0c79544aba298e4c9ce77d7562268557 1 parent 19d71a2
Malcolm Tredinnick authored May 24, 2007

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. 7  django/template/__init__.py
7  django/template/__init__.py
@@ -706,7 +706,12 @@ def resolve_variable(path, context):
706 706
                         raise
707 707
             del bits[0]
708 708
     if isinstance(current, (basestring, Promise)):
709  
-        current = force_unicode(current)
  709
+        try:
  710
+            current = force_unicode(current)
  711
+        except UnicodeDecodeError:
  712
+            # Failing to convert to unicode can happen sometimes (e.g. debug
  713
+            # tracebacks). So we allow it in this particular instance.
  714
+            pass
710 715
     return current
711 716
 
712 717
 class Node(object):

0 notes on commit 3989fee

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