diff options
author | David Lord <davidism@gmail.com> | 2021-04-15 21:16:25 -0700 |
---|---|---|
committer | David Lord <davidism@gmail.com> | 2021-04-15 21:16:25 -0700 |
commit | b2b27e399f3613b44c83ea5dbe5d422b85d33828 (patch) | |
tree | 4e09fc98b7cdaa09b989e316f6d1f22c15cf7901 /src/werkzeug/utils.py | |
parent | 0193b7dda50f12d04c35384d8b60a4ee161193d9 (diff) | |
download | werkzeug-b2b27e399f3613b44c83ea5dbe5d422b85d33828.tar.gz |
deprecate detect_utf_encoding
Diffstat (limited to 'src/werkzeug/utils.py')
-rw-r--r-- | src/werkzeug/utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/werkzeug/utils.py b/src/werkzeug/utils.py index 5b314885..cad786c7 100644 --- a/src/werkzeug/utils.py +++ b/src/werkzeug/utils.py @@ -356,8 +356,18 @@ def detect_utf_encoding(data: bytes) -> str: :param data: Bytes in unknown UTF encoding. :return: UTF encoding name + .. deprecated:: 2.0 + Will be removed in Werkzeug 2.1. This is built in to + :func:`json.loads`. + .. versionadded:: 0.15 """ + warnings.warn( + "'detect_utf_encoding' is deprecated and will be removed in" + " Werkzeug 2.1. This is built in to 'json.loads'.", + DeprecationWarning, + stacklevel=2, + ) head = data[:4] if head[:3] == codecs.BOM_UTF8: |