]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.7] Correct CVE-2020-10735 documentation (GH-100306). (GH-100699)
authorGregory P. Smith <greg@krypto.org>
Mon, 9 Jan 2023 02:17:13 +0000 (18:17 -0800)
committerGitHub <noreply@github.com>
Mon, 9 Jan 2023 02:17:13 +0000 (21:17 -0500)
Co-authored-by: Jeremy Paige <ucodery@gmail.com>.
(cherry picked from commit 88fe8d701af3316c8869ea18ea1c7acec6f68c04)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Doc/library/stdtypes.rst
Python/clinic/sysmodule.c.h
Python/sysmodule.c

index 99dc1b2be3d4f95cef9a5fbaa0460f4cce34bf59..f64957ff7fc1ec1c29c7d79f19068f5bce51d25f 100644 (file)
@@ -4751,7 +4751,7 @@ to mitigate denial of service attacks. This limit *only* applies to decimal or
 other non-power-of-two number bases. Hexadecimal, octal, and binary conversions
 are unlimited. The limit can be configured.
 
-The :class:`int` type in CPython is an abitrary length number stored in binary
+The :class:`int` type in CPython is an arbitrary length number stored in binary
 form (commonly known as a "bignum"). There exists no algorithm that can convert
 a string to a binary integer or a binary integer to a string in linear time,
 *unless* the base is a power of 2. Even the best known algorithms for base 10
@@ -4815,7 +4815,7 @@ and :class:`str` or :class:`bytes`:
 * ``int(string)`` with default base 10.
 * ``int(string, base)`` for all bases that are not a power of 2.
 * ``str(integer)``.
-* ``repr(integer)``
+* ``repr(integer)``.
 * any other string conversion to base 10, for example ``f"{integer}"``,
   ``"{}".format(integer)``, or ``b"%d" % integer``.
 
@@ -4843,7 +4843,7 @@ command line flag to configure the limit:
   :envvar:`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`.
   If both the env var and the ``-X`` option are set, the ``-X`` option takes
   precedence. A value of *-1* indicates that both were unset, thus a value of
-  :data:`sys.int_info.default_max_str_digits` was used during initilization.
+  :data:`sys.int_info.default_max_str_digits` was used during initialization.
 
 From code, you can inspect the current limit and set a new one using these
 :mod:`sys` APIs:
index bc6c99a5d65964b5829c80af09c75b986b3a05ba..2ea64314c73416bf26ede5ab841e07111af6f503 100644 (file)
@@ -68,7 +68,7 @@ PyDoc_STRVAR(sys_get_int_max_str_digits__doc__,
 "get_int_max_str_digits($module, /)\n"
 "--\n"
 "\n"
-"Set the maximum string digits limit for non-binary int<->str conversions.");
+"Return the maximum string digits limit for non-binary int<->str conversions.");
 
 #define SYS_GET_INT_MAX_STR_DIGITS_METHODDEF    \
     {"get_int_max_str_digits", (PyCFunction)sys_get_int_max_str_digits, METH_NOARGS, sys_get_int_max_str_digits__doc__},
@@ -111,4 +111,4 @@ sys_set_int_max_str_digits(PyObject *module, PyObject *const *args, Py_ssize_t n
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=c566fcdbb8f6ae2c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5351eba7518cdf76 input=a9049054013a1b77]*/
index 82e029fd38018e1ea2119b3b83a5028305ff250e..8b5e8dad2177ce4bc9cfb5f28b06fae9537d5354 100644 (file)
@@ -1223,12 +1223,12 @@ sys_mdebug(PyObject *self, PyObject *args)
 /*[clinic input]
 sys.get_int_max_str_digits
 
-Set the maximum string digits limit for non-binary int<->str conversions.
+Return the maximum string digits limit for non-binary int<->str conversions.
 [clinic start generated code]*/
 
 static PyObject *
 sys_get_int_max_str_digits_impl(PyObject *module)
-/*[clinic end generated code: output=0042f5e8ae0e8631 input=8dab13e2023e60d5]*/
+/*[clinic end generated code: output=0042f5e8ae0e8631 input=61bf9f99bc8b112d]*/
 {
     return PyLong_FromSsize_t(_PyRuntime.int_max_str_digits);
 }