Title: json.loads documentation missing "versionchanged" statement
Type: Stage:
Components: Documentation Versions: Python 3.7, Python 3.6
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: Alexey Popravka, ammar2, docs@python, python-dev, r.david.murray, rhettinger, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2017-01-16 09:19 by Alexey Popravka, last changed 2017-01-20 15:59 by ammar2. This issue is now closed.

File name Uploaded Description Edit
json_loads_bytes.diff ammar2, 2017-01-20 03:06 review
Messages (8)
msg285545 - (view) Author: Alexey Popravka (Alexey Popravka) Date: 2017-01-16 09:19
json.loads function was changed in Python 3.6 to accept
bytes and bytearrays, however documentation is missing
`versionchanged` block describing this changes.
msg285762 - (view) Author: Ammar Askar (ammar2) * (Python triager) Date: 2017-01-18 21:53
To anyone more experienced with python documentation, is behavior like this actually supposed to be documented? For some more historical context,

the support for bytes in the json module was removed in this issue:

and then re-added in this one:
msg285763 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2017-01-18 22:14
Yes, this should be documented with a versionchanged.  The removal was for python3 so we didn't need a versionchanged there; it was just a difference from python2, and the python3 docs were "restarted" with (almost) no back references to python2.
msg285869 - (view) Author: Ammar Askar (ammar2) * (Python triager) Date: 2017-01-20 03:06
Attached patch adds a versionchanged block to specify that bytes and bytesarray can now be used and the types of encodings it supports (as taken from the whatsnew changes here
msg285878 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2017-01-20 05:40
New changeset 3452ff9e8f0a by Raymond Hettinger in branch '3.6':
Issue #29281:  Fill-in a missing versionchanged entry
msg285879 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-01-20 05:41
Thanks for the patch.
msg285892 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-01-20 08:53
The wording looks little misleading. There is the encoding parameter in json.loads(). It is deprecated and ignored.
msg285914 - (view) Author: Ammar Askar (ammar2) * (Python triager) Date: 2017-01-20 15:59
Which part is misleading, do you think the use of "encoding" could be confused with the argument encoding? 

There is a note right above the versionchanged block that says:

`The other arguments have the same meaning as in load(), except encoding which is ignored and deprecated.`

If that is the concern then I think changing the wording to be, "the encoding of the input string should be ..."
Date User Action Args
2017-01-20 15:59:08ammar2setmessages: + msg285914
2017-01-20 08:53:35serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg285892
2017-01-20 05:41:14rhettingersetstatus: open -> closed
resolution: fixed
messages: + msg285879
2017-01-20 05:40:52python-devsetnosy: + python-dev
messages: + msg285878
2017-01-20 05:27:13rhettingersetassignee: docs@python -> rhettinger

nosy: + rhettinger
2017-01-20 03:06:41ammar2setfiles: + json_loads_bytes.diff
keywords: + patch
messages: + msg285869
2017-01-18 22:14:02r.david.murraysetnosy: + r.david.murray
messages: + msg285763
2017-01-18 21:53:24ammar2setnosy: + ammar2
messages: + msg285762
2017-01-16 09:19:59Alexey Popravkacreate