]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46001: Change OverflowError to RecursionError in JSON library docstrings (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 7 Dec 2021 10:25:02 +0000 (02:25 -0800)
committerGitHub <noreply@github.com>
Tue, 7 Dec 2021 10:25:02 +0000 (02:25 -0800)
(cherry picked from commit 8db06528cacc94e67eb1fb2e4c2acc061a515671)

Co-authored-by: James Gerity <snoopjedi@gmail.com>
Doc/library/json.rst
Lib/json/__init__.py
Lib/json/encoder.py

index 6fa89f578a2cfd166026ecaaeb1c3f0f19bd4453..1810e04cc83495045f26f3af9a7eda336c0386ad 100644 (file)
@@ -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``,
@@ -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
index 2c52bdeba67546e2eb96bfa3a3ba68aa5cd3483c..e4c21daaf3e47f512b0e1406b6c0cad6ab3a28a3 100644 (file)
@@ -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``)
@@ -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
index c8c78b9c237652d13a22c6d79bf171280e7eb420..21bff2c1a1fca33b336a73f8043375148beaf549 100644 (file)
@@ -116,7 +116,7 @@ class JSONEncoder(object):
 
         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