Ticket #20017: jython_format_html_fix.diff

File jython_format_html_fix.diff, 759 bytes (added by andreas@…, 2 years ago)
  • django/utils/html.py

    diff --git a/django/utils/html.py b/django/utils/html.py
    index a9ebd17..4728603 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 = map(lambda v: six.text_type(conditional_escape(v)), 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