From f09b0f6483351bdbe85598b942c9ecfc91f046a5 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Tue, 5 Feb 2019 08:19:49 -0500 Subject: [PATCH] Refs #27753 -- Removed django.utils.safestring.SafeBytes. --- django/utils/safestring.py | 21 --------------------- docs/releases/3.0.txt | 2 ++ 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/django/utils/safestring.py b/django/utils/safestring.py index 5128add622..93d74f602d 100644 --- a/django/utils/safestring.py +++ b/django/utils/safestring.py @@ -18,27 +18,6 @@ class SafeData: return self -class SafeBytes(bytes, SafeData): - """ - A bytes subclass that has been specifically marked as "safe" (requires no - further escaping) for HTML output purposes. - - Kept in Django 2.0 for usage by apps supporting Python 2. Shouldn't be used - in Django anymore. - """ - def __add__(self, rhs): - """ - Concatenating a safe byte string with another safe byte string or safe - string is safe. Otherwise, the result is no longer safe. - """ - t = super().__add__(rhs) - if isinstance(rhs, SafeText): - return SafeText(t) - elif isinstance(rhs, SafeBytes): - return SafeBytes(t) - return t - - class SafeText(str, SafeData): """ A str subclass that has been specifically marked as "safe" for HTML output diff --git a/docs/releases/3.0.txt b/docs/releases/3.0.txt index 19361cc195..a657a4b0a0 100644 --- a/docs/releases/3.0.txt +++ b/docs/releases/3.0.txt @@ -274,6 +274,8 @@ Django 3.0, we're removing these APIs at this time. * ``django.utils.functional.curry()`` - Use :func:`functools.partial` or :class:`functools.partialmethod`. See :commit:`5b1c389603a353625ae1603`. +* ``django.utils.safestring.SafeBytes`` - Unused since Django 2.0. + Miscellaneous -------------