Skip to content

Commit 8db0652

Browse files
authored
bpo-46001: Change OverflowError to RecursionError in JSON library docstrings (GH-29943)
1 parent ddbab69 commit 8db0652

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Doc/library/json.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Basic Usage
159159

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

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

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

438438
If *allow_nan* is true (the default), then ``NaN``, ``Infinity``, and

Lib/json/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def dump(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True,
133133
134134
If ``check_circular`` is false, then the circular reference check
135135
for container types will be skipped and a circular reference will
136-
result in an ``OverflowError`` (or worse).
136+
result in an ``RecursionError`` (or worse).
137137
138138
If ``allow_nan`` is false, then it will be a ``ValueError`` to
139139
serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``)
@@ -195,7 +195,7 @@ def dumps(obj, *, skipkeys=False, ensure_ascii=True, check_circular=True,
195195
196196
If ``check_circular`` is false, then the circular reference check
197197
for container types will be skipped and a circular reference will
198-
result in an ``OverflowError`` (or worse).
198+
result in an ``RecursionError`` (or worse).
199199
200200
If ``allow_nan`` is false, then it will be a ``ValueError`` to
201201
serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in

Lib/json/encoder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def __init__(self, *, skipkeys=False, ensure_ascii=True,
116116
117117
If check_circular is true, then lists, dicts, and custom encoded
118118
objects will be checked for circular references during encoding to
119-
prevent an infinite recursion (which would cause an OverflowError).
119+
prevent an infinite recursion (which would cause an RecursionError).
120120
Otherwise, no such check takes place.
121121
122122
If allow_nan is true, then NaN, Infinity, and -Infinity will be

0 commit comments

Comments
 (0)