diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-05-24 01:25:51 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-05-24 01:25:51 +0000 |
| commit | 3989feed0c79544aba298e4c9ce77d7562268557 (patch) | |
| tree | 799af4b2b75b6bc2d1d0a375c75c97cd4d1c3f06 | |
| parent | 19d71a21dfca4bec5a716162355107247530cc10 (diff) | |
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
| -rw-r--r-- | django/template/__init__.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/django/template/__init__.py b/django/template/__init__.py index 81cd75d804..a9e00a51af 100644 --- a/django/template/__init__.py +++ b/django/template/__init__.py @@ -706,7 +706,12 @@ def resolve_variable(path, context): raise 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): |
