Ticket #4367: debug_py.diff
File debug_py.diff, 1.6 KB (added by , 17 years ago) |
---|
-
django/views/debug.py
420 420 {% for var in frame.vars|dictsort:"0" %} 421 421 <tr> 422 422 <td>{{ var.0 }}</td> 423 <td class="code"><div>{{ var.1|pprint|escape }}</div></td>423 <td class="code"><div>{{ var.1|pprint|escape|smart_unicode_replace }}</div></td> 424 424 </tr> 425 425 {% endfor %} 426 426 </tbody> -
django/template/defaultfilters.py
3 3 from django.template import resolve_variable, Library 4 4 from django.conf import settings 5 5 from django.utils.translation import ugettext, ungettext 6 from django.utils.encoding import force_unicode, smart_str, iri_to_uri 6 from django.utils.encoding import force_unicode, smart_str, iri_to_uri, smart_unicode 7 7 import re 8 8 import random as random_module 9 9 … … 554 554 except Exception, e: 555 555 return u"Error in formatting:%s" % force_unicode(e) 556 556 557 def smart_unicode_replace(value): 558 return smart_unicode(value, errors='replace') 559 557 560 # Syntax: register.filter(name of filter, callback) 558 561 register.filter(add) 559 562 register.filter(addslashes) … … 606 609 register.filter(wordcount) 607 610 register.filter(wordwrap) 608 611 register.filter(yesno) 612 register.filter(smart_unicode_replace)