Code

Ticket #20017: jython_format_html_fix_v2.diff

File jython_format_html_fix_v2.diff, 754 bytes (added by andreas@…, 16 months ago)
Line 
1diff --git a/django/utils/html.py b/django/utils/html.py
2index a9ebd17..b37cd76 100644
3--- a/django/utils/html.py
4+++ b/django/utils/html.py
5@@ -80,8 +80,8 @@ def format_html(format_string, *args, **kwargs):
6     and calls 'mark_safe' on the result. This function should be used instead
7     of str.format or % interpolation to build up small HTML fragments.
8     """
9-    args_safe = map(conditional_escape, args)
10-    kwargs_safe = dict([(k, conditional_escape(v)) for (k, v) in
11+    args_safe = [six.text_type(conditional_escape(v)) for v in args]
12+    kwargs_safe = dict([(k, six.text_type(conditional_escape(v))) for (k, v) in
13                         six.iteritems(kwargs)])
14     return mark_safe(format_string.format(*args_safe, **kwargs_safe))
15