This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Typo in JSON documentation
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: asvetlov, docs@python, jordan-bonecutter, kumaraditya, serhiy.storchaka, wangjiahua
Priority: normal Keywords: patch

Created on 2021-12-22 19:12 by jordan-bonecutter, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30237 closed kumaraditya, 2021-12-23 08:39
PR 30239 merged kumaraditya, 2021-12-23 10:05
PR 30846 closed wangjiahua, 2022-01-24 08:35
Messages (10)
msg409051 - (view) Author: Jordan Bonecutter (jordan-bonecutter) Date: 2021-12-22 19:12
In this doc: https://docs.python.org/3/library/json.html#json.dump

The section on check_circular has a typo:

...a circular reference will result in an RecursionError => a RecursionError
msg409071 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-12-23 08:50
There are other similar errors:

Doc/library/json.rst:162:   will result in an :exc:`RecursionError` (or worse).
Doc/library/json.rst:435:   prevent an infinite recursion (which would cause an :exc:`RecursionError`).
Doc/library/tarfile.rst:66:   |                  | Raise an :exc:`FileExistsError` exception   |
Doc/library/tarfile.rst:70:   |                  | Raise an :exc:`FileExistsError` exception   |
Doc/library/tarfile.rst:74:   |                  | Raise an :exc:`FileExistsError` exception   |
Doc/library/tarfile.rst:78:   |                  | Raise an :exc:`FileExistsError` exception   |
Doc/library/poplib.rst:124:An :class:`POP3` instance has the following methods:
Doc/library/urllib.request.rst:1112:   implementation will raise an :exc:`ValueError` in that case.
Doc/library/enum.rst:180:      Returns the Enum member in *cls* matching *name*, or raises an :exc:`KeyError`::
Doc/library/os.rst:2084:   If *exist_ok* is ``False`` (the default), an :exc:`FileExistsError` is
Doc/library/os.rst:2360:   not empty, an :exc:`FileNotFoundError` or an :exc:`OSError` is raised
Doc/library/asyncio-eventloop.rst:900:      method, before Python 3.7 it returned an :class:`Future`.
Doc/library/asyncio-eventloop.rst:1085:   The *executor* argument should be an :class:`concurrent.futures.Executor`
Doc/whatsnew/3.9.rst:700::pep:`593` introduced an :data:`typing.Annotated` type to decorate existing
msg409072 - (view) Author: Kumar Aditya (kumaraditya) * (Python triager) Date: 2021-12-23 08:51
I'll fix them all :)
msg409074 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-12-23 08:57
Doc/using/cmdline.rst:474:   * ``-X warn_default_encoding`` issues a :class:`EncodingWarning` when the
Doc/c-api/init_config.rst:601:      If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io.TextIOWrapper`
Doc/library/fractions.rst:90:      and *denominator*. :func:`math.gcd` always return a :class:`int` type.
Doc/library/asyncio-future.rst:122:      a :exc:`InvalidStateError` exception.
Doc/library/asyncio-future.rst:128:      Raises a :exc:`InvalidStateError` error if the Future is
Doc/library/asyncio-future.rst:135:      Raises a :exc:`InvalidStateError` error if the Future is
Doc/library/inspect.rst:402:      wrapped function is a :term:`asynchronous generator` function.
Doc/library/importlib.rst:881:       Returns a :class:`importlib.abc.Traversable` object for the loaded
Doc/library/importlib.rst:960:    Given a :class:`importlib.resources.abc.Traversable` object representing
Doc/library/pathlib.rst:721:   Return a :class:`os.stat_result` object containing information about this path, like :func:`os.stat`.
Doc/library/os.rst:3412:   Provide semaphore-like semantics for reads from a :func:`eventfd` file
Doc/library/asyncio-task.rst:947:      a :exc:`InvalidStateError` exception.
Doc/library/ast.rst:782:   be a :class:`Name`, a :class:`Attribute` or a :class:`Subscript`.
Doc/library/ast.rst:1772:   must be wrapped in a :class:`Expr` node if the value sent back is not used.
Doc/library/asyncio-eventloop.rst:116:   is implicitly scheduled to run as a :class:`asyncio.Task`.
Doc/library/asyncio-eventloop.rst:357:   must return a :class:`asyncio.Future`-compatible object.
Doc/library/asyncio-eventloop.rst:1129:   This method returns a :class:`asyncio.Future` object.
Doc/glossary.rst:113:      An object created by a :term:`asynchronous generator` function.
Doc/reference/expressions.rst:216:clause may be used to iterate over a :term:`asynchronous iterator`.
Doc/reference/expressions.rst:710:   This method is normally called implicitly by a :keyword:`async for` loop.
Doc/whatsnew/3.7.rst:607:a :class:`importlib.abc.ResourceReader` instance to support this
Misc/NEWS.d/3.10.0a1.rst:825:``True``, ``False`` and ``None`` are used within a :class:`ast.Name` node.
Misc/NEWS.d/3.9.0a4.rst:407:always return a :class:`int` type. Previously, the GCD type depended on
Misc/NEWS.d/3.9.0b1.rst:394:When a :class:`asyncio.Task` is cancelled, the exception traceback now
msg409075 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-12-23 09:11
Thank you Kumar.

These errors were found with the following one-liners:

$ find -name '*.rst' -exec egrep --color -i '\ban +:[a-z:]+:`[qwrtpsdfghjklzxcvbnm]' '{}' +
$ find -name '*.rst' -exec egrep --color -i '\ba +:[a-z:]+:`[eyuioa]' '{}' +

They produce a lot of false positive results because of signatures and different reading of initial "y" and "u" (and "o", but there are no such cases here).
msg409076 - (view) Author: Kumar Aditya (kumaraditya) * (Python triager) Date: 2021-12-23 09:14
I have fixed most of them in the PR which I found correct, rest can be fixed later on.
msg409077 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-12-23 09:16
And more errors can be found with:

$ find -name '*.rst' -exec egrep --color -i '\ban +[qwrtpsdfghjklzxcvbnm]' '{}' +
$ find -name '*.rst' -exec egrep --color -i '\ba +[eioa]' '{}' +

It is worth to check also:

$ find -name '*.rst' -exec egrep --color -i '\ban +[yu]' '{}' +
$ find -name '*.rst' -exec egrep --color -i '\ba +[yu]' '{}' +

Most of them should be correct, but there may be some new errors.
msg409078 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2021-12-23 09:17
New changeset 71ef0b4c2b77195bb1adc42602549284f7ee9566 by Kumar Aditya in branch 'main':
bpo-46157: fix typo in docs (GH-30237)
https://github.com/python/cpython/commit/71ef0b4c2b77195bb1adc42602549284f7ee9566
msg409082 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-12-23 09:55
PR 30237 introduced few new errors.
msg409083 - (view) Author: Kumar Aditya (kumaraditya) * (Python triager) Date: 2021-12-23 10:09
Fixed in a new PR @Serhiy
History
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90315
2022-01-24 08:46:43serhiy.storchakasetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: - Python 3.9, Python 3.10
2022-01-24 08:35:38wangjiahuasetnosy: + wangjiahua
pull_requests: + pull_request29028
2021-12-23 10:09:00kumaradityasetmessages: + msg409083
2021-12-23 10:05:59kumaradityasetpull_requests: + pull_request28461
2021-12-23 09:55:32serhiy.storchakasetmessages: + msg409082
2021-12-23 09:17:47asvetlovsetnosy: + asvetlov
messages: + msg409078
2021-12-23 09:16:53serhiy.storchakasetversions: + Python 3.9, Python 3.10, Python 3.11
2021-12-23 09:16:41serhiy.storchakasetmessages: + msg409077
2021-12-23 09:14:04kumaradityasetmessages: + msg409076
2021-12-23 09:11:32serhiy.storchakasetmessages: + msg409075
2021-12-23 08:57:21serhiy.storchakasetmessages: + msg409074
2021-12-23 08:51:32kumaradityasetmessages: + msg409072
2021-12-23 08:50:03serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg409071
2021-12-23 08:39:42kumaradityasetkeywords: + patch
nosy: + kumaraditya

pull_requests: + pull_request28458
stage: patch review
2021-12-22 19:12:06jordan-bonecuttercreate