From 5c5eb5fea4d7dcd2b0eed982021cfa8aeee2efd8 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Tue, 23 Dec 2014 21:49:05 +0100 Subject: Fixed an inconsistency introduced in 547b1810. mark_safe and mark_for_escaping should have been kept similar. On Python 2 this change has no effect. On Python 3 it fixes the use case shown in the regression test for mark_for_escaping, which used to raise a TypeError. The regression test for mark_safe is just for completeness. --- django/utils/safestring.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django') diff --git a/django/utils/safestring.py b/django/utils/safestring.py index ad8054fe0f..50b0c03686 100644 --- a/django/utils/safestring.py +++ b/django/utils/safestring.py @@ -144,4 +144,4 @@ def mark_for_escaping(s): return EscapeBytes(s) if isinstance(s, (six.text_type, Promise)): return EscapeText(s) - return EscapeBytes(bytes(s)) + return EscapeString(str(s)) -- cgit v1.3