Skip to content

Commit 8acc891

Browse files
committed
hexadecimal spelling =)
1 parent 0504ecb commit 8acc891

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

Doc/library/stdtypes.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4884,7 +4884,7 @@ Integer string conversion length limitation
48844884

48854885
CPython has a global limit for converting between :class:`int` and :class:`str`
48864886
to mitigate denial of service attacks. This limit *only* applies to decimal or
4887-
other non-power-of-two number bases. Hexidecimal, octal, and binary conversions
4887+
other non-power-of-two number bases. Hexadecimal, octal, and binary conversions
48884888
are unlimited. The limit can be configured.
48894889

48904890
The :class:`int` type in CPython is an abitrary length number stored in binary
@@ -4921,7 +4921,7 @@ When an operation would exceed the limit, a :exc:`ValueError` is raised:
49214921
ValueError: Exceeds the limit (4300) for integer string conversion: value has 8599 digits.
49224922
>>> len(hex(i_squared))
49234923
7144
4924-
>>> assert int(hex(i_squared), base=16) == i*i # Hexidecimal is unlimited.
4924+
>>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited.
49254925

49264926
The default limit is 4300 digits as provided in
49274927
:data:`sys.int_info.default_max_str_digits <sys.int_info>`.
@@ -5006,7 +5006,7 @@ Information about the default and minimum can be found in :attr:`sys.int_info`:
50065006
encounter an error during parsing, usually at startup time or import time or
50075007
even at installation time - anytime an up to date ``.pyc`` does not already
50085008
exist for the code. A workaround for source that contains such large
5009-
constants is to convert them to ``0x`` hexidecimal form as it has no limit.
5009+
constants is to convert them to ``0x`` hexadecimal form as it has no limit.
50105010

50115011
Test your application thoroughly if you use a low limit. Ensure your tests
50125012
run with the limit set early via the environment or flag so that it applies

Doc/whatsnew/3.8.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2330,7 +2330,7 @@ Notable security feature in 3.8.14
23302330
==================================
23312331

23322332
Converting between :class:`int` and :class:`str` in bases other than 2
2333-
(binary), 4, 8 (octal), 16 (hexidecimal), or 32 such as base 10 (decimal)
2333+
(binary), 4, 8 (octal), 16 (hexadecimal), or 32 such as base 10 (decimal)
23342334
now raises a :exc:`ValueError` if the number of digits in string form is
23352335
above a limit to avoid potential denial of service attacks due to the
23362336
algorithmic complexity. This is a mitigation for `CVE-2020-10735

Lib/test/test_ast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ def test_literal_eval_str_int_limit(self):
891891
with self.assertRaises(SyntaxError) as err_ctx:
892892
ast.literal_eval('3'*4001)
893893
self.assertIn('Exceeds the limit ', str(err_ctx.exception))
894-
self.assertIn(' Consider hexidecimal ', str(err_ctx.exception))
894+
self.assertIn(' Consider hexadecimal ', str(err_ctx.exception))
895895

896896
def test_literal_eval_complex(self):
897897
# Issue #4907

Lib/test/test_compile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def test_int_literals_too_long(self):
200200
exc = err_ctx.exception
201201
self.assertEqual(exc.lineno, 3)
202202
self.assertIn('Exceeds the limit ', str(exc))
203-
self.assertIn(' Consider hexidecimal ', str(exc))
203+
self.assertIn(' Consider hexadecimal ', str(exc))
204204

205205
def test_unary_minus(self):
206206
# Verify treatment of unary minus on negative numbers SF bug #660455

Misc/NEWS.d/next/Security/2022-08-07-16-53-38.gh-issue-95778.ch010gps.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Converting between :class:`int` and :class:`str` in bases other than 2
2-
(binary), 4, 8 (octal), 16 (hexidecimal), or 32 such as base 10 (decimal) now
2+
(binary), 4, 8 (octal), 16 (hexadecimal), or 32 such as base 10 (decimal) now
33
raises a :exc:`ValueError` if the number of digits in string form is above a
44
limit to avoid potential denial of service attacks due to the algorithmic
55
complexity. This is a mitigation for `CVE-2020-10735

Python/ast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2472,7 +2472,7 @@ ast_for_atom(struct compiling *c, const node *n)
24722472
Py_XDECREF(tb);
24732473
Py_DECREF(type);
24742474
ast_error(c, ch,
2475-
"%S - Consider hexidecimal for huge integer literals "
2475+
"%S - Consider hexadecimal for huge integer literals "
24762476
"to avoid decimal conversion limits.",
24772477
value);
24782478
Py_DECREF(value);

0 commit comments

Comments
 (0)