classification
Title: The referenced RFC for the json module should be corrected to rfc8259
Type: enhancement Stage: patch review
Components: Documentation Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: amaajemyfren, docs@python, ezio.melotti, rhettinger, terry.reedy
Priority: normal Keywords: patch

Created on 2020-03-27 16:23 by amaajemyfren, last changed 2020-03-29 15:56 by amaajemyfren.

Pull Requests
URL Status Linked Edit
PR 19197 closed amaajemyfren, 2020-03-27 17:47
Messages (3)
msg365162 - (view) Author: Ama Aje My Fren (amaajemyfren) * Date: 2020-03-27 16:23
Currently the Documentation of the json library module refers to :rfc:`7159` . That RFC has however been obsoleted by :rfc:`8259`. 

The Documentation for :mod:`json` should be changed to indicate this.
msg365237 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-03-28 23:09
The header for 8259 says "Obsoletes: 7159" (December 2017) and the header for 7159 agrees: "Obsoleted by: 8259".  But... to the extent that there is any difference, which document better describes the behavior of our json module?  Does it need to be updated along with a doc change?
msg365265 - (view) Author: Ama Aje My Fren (amaajemyfren) * Date: 2020-03-29 15:56
I am not the expert on this but I did a swift check of the two documents
before doing the documentation PR
<https://github.com/python/cpython/pull/19197>.

From my reading of the two, RFC8259
<https://tools.ietf.org/html/rfc8259#section-1.3> seems that:

   This document's goal is to apply the errata, remove inconsistencies
   with other specifications of JSON, and highlight practices that can
   lead to interoperability problems.

When one reads a diff of the two RFCs together
<https://www.diffchecker.com/xJoy0BDJ>, the only place that seems to
have changed from a protocol point of view is in Section 8.1 (RFC 7159
<https://tools.ietf.org/html/rfc7159#section-8.1>, RFC 8259
<https://tools.ietf.org/html/rfc8259#section-8.1>)  which now (RFC
8259) requires that all data should be encoded using UTF-8.

The security section <https://tools.ietf.org/html/rfc8259#section-12>
in the current (RFC 8259) standard states:

   certain characters such as U+2028 LINE SEPARATOR and U+2029
   PARAGRAPH SEPARATOR are legal in JSON but not JavaScript

(This has changed in the latest ECMAScript Edition)

Therefore from my understanding:

1. which document better describes the behavior of our json module?

 The json module allows for utf-16 and utf-32 encoding in the loads
method. It does not appear to enforce the utf-8 encoding - so closer
to RFC 7159.

2. Does it need to be updated along with a doc change?

Maybe. I defer to the maintainers of the module.

On Sun, Mar 29, 2020 at 2:09 AM Terry J. Reedy <report@bugs.python.org>
wrote:

>
> Terry J. Reedy <tjreedy@udel.edu> added the comment:
>
> The header for 8259 says "Obsoletes: 7159" (December 2017) and the header
> for 7159 agrees: "Obsoleted by: 8259".  But... to the extent that there is
> any difference, which document better describes the behavior of our json
> module?  Does it need to be updated along with a doc change?
>
> ----------
> nosy: +ezio.melotti, rhettinger, terry.reedy
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue40090>
> _______________________________________
>
History
Date User Action Args
2020-03-29 15:56:02amaajemyfrensetmessages: + msg365265
2020-03-28 23:09:49terry.reedysetnosy: + rhettinger, ezio.melotti, terry.reedy
messages: + msg365237
2020-03-27 17:47:46amaajemyfrensetkeywords: + patch
stage: patch review
pull_requests: + pull_request18558
2020-03-27 16:23:40amaajemyfrencreate