1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #27753 -- Deprecated django.utils.encoding.force_text() and smart_text().

This commit is contained in:
Tim Graham
2019-02-05 09:19:49 -05:00
parent 3bb6a4390c
commit d55e882927
5 changed files with 54 additions and 2 deletions

View File

@@ -18,6 +18,8 @@ details on these changes.
* ``django.utils.http.urlquote()``, ``urlquote_plus()``, ``urlunquote()``, and
``urlunquote_plus()`` will be removed.
* ``django.utils.encoding.force_text()`` and ``smart_text()`` will be removed.
.. _deprecation-removed-in-3.1:
3.1

View File

@@ -232,11 +232,15 @@ The functions defined in this module share the following properties:
.. function:: smart_text(s, encoding='utf-8', strings_only=False, errors='strict')
.. deprecated:: 3.0
Alias of :func:`force_str` for backwards compatibility, especially in code
that supports Python 2.
.. function:: force_text(s, encoding='utf-8', strings_only=False, errors='strict')
.. deprecated:: 3.0
Alias of :func:`force_str` for backwards compatibility, especially in code
that supports Python 2.

View File

@@ -292,6 +292,14 @@ Miscellaneous
Features deprecated in 3.0
==========================
``django.utils.encoding.force_text()`` and ``smart_text()``
-----------------------------------------------------------
The ``smart_text()`` and ``force_text()`` aliases (since Django 2.0) of
``smart_str()`` and ``force_str()`` are deprecated. Ignore this deprecation if
your code supports Python 2 as the behavior of ``smart_str()`` and
``force_str()`` is different there.
Miscellaneous
-------------