Django

Code

Changeset 5323

Show
Ignore:
Timestamp:
05/23/07 20:25:51 (2 years ago)
Author:
mtredinnick
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/unicode/django/template/__init__.py

    r5320 r5323  
    707707            del bits[0] 
    708708    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 
    710715    return current 
    711716