diff options
author | Inada Naoki <songofacandy@gmail.com> | 2020-01-20 04:54:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-20 04:54:00 (GMT) |
commit | 5492bfcefec67b016e8239c0e9135bc2f03e3058 (patch) | |
tree | 4f37014e587cdec0340a77e65db720bdf83e094e /Lib/json | |
parent | e96d954527aa376457451e32a9d75ae3ea9ab4bd (diff) | |
download | cpython-5492bfcefec67b016e8239c0e9135bc2f03e3058.zip cpython-5492bfcefec67b016e8239c0e9135bc2f03e3058.tar.gz cpython-5492bfcefec67b016e8239c0e9135bc2f03e3058.tar.bz2 |
bpo-39377: json: Remove the encoding option. (GH-18075)
Diffstat (limited to 'Lib/json')
-rw-r--r-- | Lib/json/__init__.py | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/Lib/json/__init__.py b/Lib/json/__init__.py index 1ba8b48..2c52bde 100644 --- a/Lib/json/__init__.py +++ b/Lib/json/__init__.py @@ -329,8 +329,6 @@ def loads(s, *, cls=None, object_hook=None, parse_float=None, To use a custom ``JSONDecoder`` subclass, specify it with the ``cls`` kwarg; otherwise ``JSONDecoder`` is used. - - The ``encoding`` argument is ignored and deprecated since Python 3.1. """ if isinstance(s, str): if s.startswith('\ufeff'): @@ -342,15 +340,6 @@ def loads(s, *, cls=None, object_hook=None, parse_float=None, f'not {s.__class__.__name__}') s = s.decode(detect_encoding(s), 'surrogatepass') - if "encoding" in kw: - import warnings - warnings.warn( - "'encoding' is ignored and deprecated. It will be removed in Python 3.9", - DeprecationWarning, - stacklevel=2 - ) - del kw['encoding'] - if (cls is None and object_hook is None and parse_int is None and parse_float is None and parse_constant is None and object_pairs_hook is None and not kw): |