From 59dac4e82cd6766fc31a9389d573d732580eaab5 Mon Sep 17 00:00:00 2001 From: Bob Ippolito Date: Tue, 4 Apr 2023 10:59:13 -0700 Subject: SJ-PT-23-03: Backport integer string length limitation to limit quadratic parsing --- index.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'index.rst') diff --git a/index.rst b/index.rst index fbb52b5..a10ccb7 100644 --- a/index.rst +++ b/index.rst @@ -412,6 +412,13 @@ Basic Usage be used to use another datatype or parser for JSON integers (e.g. :class:`float`). + .. versionchanged:: 3.19.0 + The integer to string conversion length limitation introduced in + Python 3.11 has been backported. An attempt to parse an integer + with more than 4300 digits will result in an exception unless a + suitable alternative parser is specified + (e.g. :class:`decimal.Decimal`) + *parse_constant*, if specified, will be called with one of the following strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be used to raise an exception if invalid JSON numbers are encountered. @@ -502,6 +509,13 @@ Encoders and decoders be used to use another datatype or parser for JSON integers (e.g. :class:`float`). + .. versionchanged:: 3.19.0 + The integer to string conversion length limitation introduced in + Python 3.11 has been backported. An attempt to parse an integer + with more than 4300 digits will result in an exception unless a + suitable alternative parser is specified + (e.g. :class:`decimal.Decimal`) + *parse_constant*, if specified, will be called with one of the following strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be used to raise an exception if invalid JSON numbers are encountered. -- cgit v1.2.1