summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2019-02-05 08:19:49 -0500
committerTim Graham <timograham@gmail.com>2019-02-05 13:00:15 -0500
commitf09b0f6483351bdbe85598b942c9ecfc91f046a5 (patch)
tree4e11467d8f9f9e7c7a4995446d2b9032cd508e37
parent3004d7057f2798c348e263d5d902eeb1e20464d5 (diff)
Refs #27753 -- Removed django.utils.safestring.SafeBytes.
-rw-r--r--django/utils/safestring.py21
-rw-r--r--docs/releases/3.0.txt2
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
-------------