Skip to content

Commit 594ba19

Browse files
gpsheaducodery
andauthored
[3.8] Correct CVE-2020-10735 documentation (GH-100306) (#100698)
(cherry picked from commit 1cf3d78) (cherry picked from commit 88fe8d7) Co-authored-by: Jeremy Paige <[email protected]> Co-authored-by: Gregory P. Smith <[email protected]>
1 parent 6924cba commit 594ba19

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
@@ -4880,7 +4880,7 @@ to mitigate denial of service attacks. This limit *only* applies to decimal or
48804880
other non-power-of-two number bases. Hexadecimal, octal, and binary conversions
48814881
are unlimited. The limit can be configured.
48824882

4883-
The :class:`int` type in CPython is an abitrary length number stored in binary
4883+
The :class:`int` type in CPython is an arbitrary length number stored in binary
48844884
form (commonly known as a "bignum"). There exists no algorithm that can convert
48854885
a string to a binary integer or a binary integer to a string in linear time,
48864886
*unless* the base is a power of 2. Even the best known algorithms for base 10
@@ -4944,7 +4944,7 @@ and :class:`str` or :class:`bytes`:
49444944
* ``int(string)`` with default base 10.
49454945
* ``int(string, base)`` for all bases that are not a power of 2.
49464946
* ``str(integer)``.
4947-
* ``repr(integer)``
4947+
* ``repr(integer)``.
49484948
* any other string conversion to base 10, for example ``f"{integer}"``,
49494949
``"{}".format(integer)``, or ``b"%d" % integer``.
49504950

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

49774977
From code, you can inspect the current limit and set a new one using these
49784978
: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
@@ -1615,12 +1615,12 @@ sys_mdebug_impl(PyObject *module, int flag)
16151615
/*[clinic input]
16161616
sys.get_int_max_str_digits
16171617
1618-
Set the maximum string digits limit for non-binary int<->str conversions.
1618+
Return the maximum string digits limit for non-binary int<->str conversions.
16191619
[clinic start generated code]*/
16201620

16211621
static PyObject *
16221622
sys_get_int_max_str_digits_impl(PyObject *module)
1623-
/*[clinic end generated code: output=0042f5e8ae0e8631 input=8dab13e2023e60d5]*/
1623+
/*[clinic end generated code: output=0042f5e8ae0e8631 input=61bf9f99bc8b112d]*/
16241624
{
16251625
PyInterpreterState *interp = _PyInterpreterState_Get();
16261626
return PyLong_FromSsize_t(interp->int_max_str_digits);

0 commit comments

Comments
 (0)