Skip to content

Commit cf71e19

Browse files
gpsheaducodery
andauthored
[3.9] Correct CVE-2020-10735 documentation (GH-100306). (#100697)
(cherry picked from commit 1cf3d78) (cherry picked from commit 88fe8d7) Co-authored-by: Jeremy Paige <ucodery@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
1 parent 5ef90ee commit cf71e19

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Doc/library/stdtypes.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -5254,7 +5254,7 @@ to mitigate denial of service attacks. This limit *only* applies to decimal or
52545254
other non-power-of-two number bases. Hexadecimal, octal, and binary conversions
52555255
are unlimited. The limit can be configured.
52565256

5257-
The :class:`int` type in CPython is an abitrary length number stored in binary
5257+
The :class:`int` type in CPython is an arbitrary length number stored in binary
52585258
form (commonly known as a "bignum"). There exists no algorithm that can convert
52595259
a string to a binary integer or a binary integer to a string in linear time,
52605260
*unless* the base is a power of 2. Even the best known algorithms for base 10
@@ -5318,7 +5318,7 @@ and :class:`str` or :class:`bytes`:
53185318
* ``int(string)`` with default base 10.
53195319
* ``int(string, base)`` for all bases that are not a power of 2.
53205320
* ``str(integer)``.
5321-
* ``repr(integer)``
5321+
* ``repr(integer)``.
53225322
* any other string conversion to base 10, for example ``f"{integer}"``,
53235323
``"{}".format(integer)``, or ``b"%d" % integer``.
53245324

@@ -5346,7 +5346,7 @@ command line flag to configure the limit:
53465346
:envvar:`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`.
53475347
If both the env var and the ``-X`` option are set, the ``-X`` option takes
53485348
precedence. A value of *-1* indicates that both were unset, thus a value of
5349-
:data:`sys.int_info.default_max_str_digits` was used during initilization.
5349+
:data:`sys.int_info.default_max_str_digits` was used during initialization.
53505350

53515351
From code, you can inspect the current limit and set a new one using these
53525352
:mod:`sys` APIs:

Python/clinic/sysmodule.c.h

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/sysmodule.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1643,12 +1643,12 @@ sys_mdebug_impl(PyObject *module, int flag)
16431643
/*[clinic input]
16441644
sys.get_int_max_str_digits
16451645
1646-
Set the maximum string digits limit for non-binary int<->str conversions.
1646+
Return the maximum string digits limit for non-binary int<->str conversions.
16471647
[clinic start generated code]*/
16481648

16491649
static PyObject *
16501650
sys_get_int_max_str_digits_impl(PyObject *module)
1651-
/*[clinic end generated code: output=0042f5e8ae0e8631 input=8dab13e2023e60d5]*/
1651+
/*[clinic end generated code: output=0042f5e8ae0e8631 input=61bf9f99bc8b112d]*/
16521652
{
16531653
PyInterpreterState *interp = _PyInterpreterState_GET();
16541654
return PyLong_FromSsize_t(interp->int_max_str_digits);

0 commit comments

Comments
 (0)