diff options
author | Matthias Bussonnier <bussonniermatthias@gmail.com> | 2019-04-09 07:17:25 (GMT) |
---|---|---|
committer | Inada Naoki <songofacandy@gmail.com> | 2019-04-09 07:17:25 (GMT) |
commit | a8abe097c1165db25b429ca02a65c4f8acbc062b (patch) | |
tree | d34fbcd712d64413f1754eadbaca13acd21a57e1 /Doc | |
parent | 5909ad1217aad200c69ffa794fcab285bacb609e (diff) | |
download | cpython-a8abe097c1165db25b429ca02a65c4f8acbc062b.zip cpython-a8abe097c1165db25b429ca02a65c4f8acbc062b.tar.gz cpython-a8abe097c1165db25b429ca02a65c4f8acbc062b.tar.bz2 |
bpo-33461: emit DeprecationWarning when json.loads(encoding=...) is used (GH-6762)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/json.rst | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Doc/library/json.rst b/Doc/library/json.rst index 589e86c..b476c37 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -265,18 +265,21 @@ Basic Usage *fp* can now be a :term:`binary file`. The input encoding should be UTF-8, UTF-16 or UTF-32. -.. function:: loads(s, *, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw) +.. function:: loads(s, *, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw) Deserialize *s* (a :class:`str`, :class:`bytes` or :class:`bytearray` instance containing a JSON document) to a Python object using this :ref:`conversion table <json-to-py-table>`. The other arguments have the same meaning as in :func:`load`, except - *encoding* which is ignored and deprecated. + *encoding* which is ignored and deprecated since Python 3.1. If the data being deserialized is not a valid JSON document, a :exc:`JSONDecodeError` will be raised. + .. deprecated-removed:: 3.1 3.9 + *encoding* keyword argument. + .. versionchanged:: 3.6 *s* can now be of type :class:`bytes` or :class:`bytearray`. The input encoding should be UTF-8, UTF-16 or UTF-32. |