Ticket #20017: jython_format_html_fix_v2.diff

File jython_format_html_fix_v2.diff, 754 bytes (added by andreas@…, 12 years ago)
  • django/utils/html.py

    diff --git a/django/utils/html.py b/django/utils/html.py
    index a9ebd17..b37cd76 100644
    a b def format_html(format_string, *args, **kwargs):  
    8080    and calls 'mark_safe' on the result. This function should be used instead
    8181    of str.format or % interpolation to build up small HTML fragments.
    8282    """
    83     args_safe = map(conditional_escape, args)
    84     kwargs_safe = dict([(k, conditional_escape(v)) for (k, v) in
     83    args_safe = [six.text_type(conditional_escape(v)) for v in args]
     84    kwargs_safe = dict([(k, six.text_type(conditional_escape(v))) for (k, v) in
    8585                        six.iteritems(kwargs)])
    8686    return mark_safe(format_string.format(*args_safe, **kwargs_safe))
    8787
Back to Top