Mailing List Archive

bpo-46001: Change OverflowError to RecursionError in JSON library docstrings (GH-29943)
https://github.com/python/cpython/commit/8db06528cacc94e67eb1fb2e4c2acc061a515671
commit: 8db06528cacc94e67eb1fb2e4c2acc061a515671
branch: main
author: James Gerity <snoopjedi@gmail.com>
committer: serhiy-storchaka <storchaka@gmail.com>
date: 2021-12-07T11:58:40+02:00
summary:

bpo-46001: Change OverflowError to RecursionError in JSON library docstrings (GH-29943)

files:
M Doc/library/json.rst
M Lib/json/__init__.py
M Lib/json/encoder.py

diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index 6fa89f578a2cf..1810e04cc8349 100644
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -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
diff --git a/Lib/json/__init__.py b/Lib/json/__init__.py
index 2c52bdeba6754..e4c21daaf3e47 100644
--- a/Lib/json/__init__.py
+++ b/Lib/json/__init__.py
@@ -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
diff --git a/Lib/json/encoder.py b/Lib/json/encoder.py
index c8c78b9c23765..21bff2c1a1fca 100644
--- a/Lib/json/encoder.py
+++ b/Lib/json/encoder.py
@@ -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

_______________________________________________
Python-checkins mailing list
Python-checkins@python.org
https://mail.python.org/mailman/listinfo/python-checkins
bpo-46001: Change OverflowError to RecursionError in JSON library docstrings (GH-29943) [ In reply to ]
https://github.com/python/cpython/commit/15da2a2723245710f1bd2c7cbd5b450532ae7728
commit: 15da2a2723245710f1bd2c7cbd5b450532ae7728
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
committer: miss-islington <31488909+miss-islington@users.noreply.github.com>
date: 2021-12-07T02:20:10-08:00
summary:

bpo-46001: Change OverflowError to RecursionError in JSON library docstrings (GH-29943)

(cherry picked from commit 8db06528cacc94e67eb1fb2e4c2acc061a515671)

Co-authored-by: James Gerity <snoopjedi@gmail.com>

files:
M Doc/library/json.rst
M Lib/json/__init__.py
M Lib/json/encoder.py

diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index 6fa89f578a2cf..1810e04cc8349 100644
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -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
diff --git a/Lib/json/__init__.py b/Lib/json/__init__.py
index 2c52bdeba6754..e4c21daaf3e47 100644
--- a/Lib/json/__init__.py
+++ b/Lib/json/__init__.py
@@ -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
diff --git a/Lib/json/encoder.py b/Lib/json/encoder.py
index c8c78b9c23765..21bff2c1a1fca 100644
--- a/Lib/json/encoder.py
+++ b/Lib/json/encoder.py
@@ -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

_______________________________________________
Python-checkins mailing list
Python-checkins@python.org
https://mail.python.org/mailman/listinfo/python-checkins
bpo-46001: Change OverflowError to RecursionError in JSON library docstrings (GH-29943) [ In reply to ]
https://github.com/python/cpython/commit/2e360832d7ed2697d715e93cb9f859a52264d60b
commit: 2e360832d7ed2697d715e93cb9f859a52264d60b
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
committer: miss-islington <31488909+miss-islington@users.noreply.github.com>
date: 2021-12-07T02:25:02-08:00
summary:

bpo-46001: Change OverflowError to RecursionError in JSON library docstrings (GH-29943)

(cherry picked from commit 8db06528cacc94e67eb1fb2e4c2acc061a515671)

Co-authored-by: James Gerity <snoopjedi@gmail.com>

files:
M Doc/library/json.rst
M Lib/json/__init__.py
M Lib/json/encoder.py

diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index 6fa89f578a2cf..1810e04cc8349 100644
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -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
diff --git a/Lib/json/__init__.py b/Lib/json/__init__.py
index 2c52bdeba6754..e4c21daaf3e47 100644
--- a/Lib/json/__init__.py
+++ b/Lib/json/__init__.py
@@ -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
diff --git a/Lib/json/encoder.py b/Lib/json/encoder.py
index c8c78b9c23765..21bff2c1a1fca 100644
--- a/Lib/json/encoder.py
+++ b/Lib/json/encoder.py
@@ -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

_______________________________________________
Python-checkins mailing list
Python-checkins@python.org
https://mail.python.org/mailman/listinfo/python-checkins