summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2016-09-10 10:16:18 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2016-09-10 10:16:18 (GMT)
commitb161562f72a28e83e62ec0a0a5de601e7724629f (patch)
treecdcfdd5c358fd7bcc4007dadd1aede5e66964396 /Doc
parent457fc9a69e7918e3c10319604903915c2f2ecd9a (diff)
downloadcpython-b161562f72a28e83e62ec0a0a5de601e7724629f.zip
cpython-b161562f72a28e83e62ec0a0a5de601e7724629f.tar.gz
cpython-b161562f72a28e83e62ec0a0a5de601e7724629f.tar.bz2
Issue #17909: Accept binary input in json.loads
json.loads (and hence json.load) now support binary input encoded as UTF-8, UTF-16 or UTF-32. Patch by Serhiy Storchaka.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/json.rst5
-rw-r--r--Doc/whatsnew/3.6.rst8
2 files changed, 11 insertions, 2 deletions
diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index 73824f8..302f839 100644
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -268,8 +268,9 @@ Basic Usage
.. function:: loads(s, *, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)
- Deserialize *s* (a :class:`str` instance containing a JSON document) to a
- Python object using this :ref:`conversion table <json-to-py-table>`.
+ 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.
diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst
index 4083f39..59ac332 100644
--- a/Doc/whatsnew/3.6.rst
+++ b/Doc/whatsnew/3.6.rst
@@ -680,6 +680,14 @@ restriction that :class:`importlib.machinery.BuiltinImporter` and
:term:`path-like object`.
+json
+----
+
+:func:`json.load` and :func:`json.loads` now support binary input. Encoded
+JSON should be represented using either UTF-8, UTF-16, or UTF-32.
+(Contributed by Serhiy Storchaka in :issue:`17909`.)
+
+
os
--