Skip to content

Commit

Permalink
bpo-46001: Change OverflowError to RecursionError in JSON library doc…
Browse files Browse the repository at this point in the history
…strings (GH-29943)
  • Loading branch information
SnoopJ committed Dec 7, 2021
1 parent ddbab69 commit 8db0652
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Doc/library/json.rst
Expand Up @@ -159,7 +159,7 @@ Basic Usage

If *check_circular* is false (default: ``True``), then the circular
reference check for container types will be skipped and a circular reference
will result in an :exc:`OverflowError` (or worse).
will result in an :exc:`RecursionError` (or worse).

If *allow_nan* is false (default: ``True``), then it will be a
:exc:`ValueError` to serialize out of range :class:`float` values (``nan``,
Expand Down Expand Up @@ -432,7 +432,7 @@ Encoders and Decoders

If *check_circular* is true (the default), then lists, dicts, and custom
encoded objects will be checked for circular references during encoding to
prevent an infinite recursion (which would cause an :exc:`OverflowError`).
prevent an infinite recursion (which would cause an :exc:`RecursionError`).
Otherwise, no such check takes place.

If *allow_nan* is true (the default), then ``NaN``, ``Infinity``, and
Expand Down
4 changes: 2 additions & 2 deletions Lib/json/__init__.py
Expand Up @@ -133,7 +133,7 @@ def dump(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True,
If ``check_circular`` is false, then the circular reference check
for container types will be skipped and a circular reference will
result in an ``OverflowError`` (or worse).
result in an ``RecursionError`` (or worse).
If ``allow_nan`` is false, then it will be a ``ValueError`` to
serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``)
Expand Down Expand Up @@ -195,7 +195,7 @@ def dumps(obj, *, skipkeys=False, ensure_ascii=True, check_circular=True,
If ``check_circular`` is false, then the circular reference check
for container types will be skipped and a circular reference will
result in an ``OverflowError`` (or worse).
result in an ``RecursionError`` (or worse).
If ``allow_nan`` is false, then it will be a ``ValueError`` to
serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in
Expand Down
2 changes: 1 addition & 1 deletion Lib/json/encoder.py
Expand Up @@ -116,7 +116,7 @@ def __init__(self, *, skipkeys=False, ensure_ascii=True,
If check_circular is true, then lists, dicts, and custom encoded
objects will be checked for circular references during encoding to
prevent an infinite recursion (which would cause an OverflowError).
prevent an infinite recursion (which would cause an RecursionError).
Otherwise, no such check takes place.
If allow_nan is true, then NaN, Infinity, and -Infinity will be
Expand Down

0 comments on commit 8db0652

Please sign in to comment.