Open 12e8d89b-a6d6-4e25-b33b-5c2a7ce48f2d opened 4 years ago
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.
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?
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:
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.
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\
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields: ```python assignee = None closed_at = None created_at =
labels = ['3.8', 'type-feature', '3.7', '3.9', 'docs']
title = 'The referenced RFC for the json module should be corrected to rfc8259'
updated_at =
user = 'https://github.com/amaajemyfren'
```
bugs.python.org fields:
```python
activity =
actor = 'amaajemyfren'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation =
creator = 'amaajemyfren'
dependencies = []
files = []
hgrepos = []
issue_num = 40090
keywords = ['patch']
message_count = 3.0
messages = ['365162', '365237', '365265']
nosy_count = 5.0
nosy_names = ['rhettinger', 'terry.reedy', 'ezio.melotti', 'docs@python', 'amaajemyfren']
pr_nums = ['19197']
priority = 'normal'
resolution = None
stage = 'patch review'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue40090'
versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']
```