Skip to content

Commit db48ddc

Browse files
committed
hexadecimal spelling =)
1 parent 67905b2 commit db48ddc

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
@@ -4755,7 +4755,7 @@ Integer string conversion length limitation
47554755

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

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

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

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

Doc/whatsnew/3.7.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2606,7 +2606,7 @@ Notable security feature in 3.7.14
26062606
==================================
26072607

26082608
Converting between :class:`int` and :class:`str` in bases other than 2
2609-
(binary), 4, 8 (octal), 16 (hexidecimal), or 32 such as base 10 (decimal)
2609+
(binary), 4, 8 (octal), 16 (hexadecimal), or 32 such as base 10 (decimal)
26102610
now raises a :exc:`ValueError` if the number of digits in string form is
26112611
above a limit to avoid potential denial of service attacks due to the
26122612
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
@@ -638,7 +638,7 @@ def test_literal_eval_str_int_limit(self):
638638
with self.assertRaises(SyntaxError) as err_ctx:
639639
ast.literal_eval('3'*4001)
640640
self.assertIn('Exceeds the limit ', str(err_ctx.exception))
641-
self.assertIn(' Consider hexidecimal ', str(err_ctx.exception))
641+
self.assertIn(' Consider hexadecimal ', str(err_ctx.exception))
642642

643643
def test_literal_eval_complex(self):
644644
# 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
@@ -2151,7 +2151,7 @@ ast_for_atom(struct compiling *c, const node *n)
21512151
Py_XDECREF(tb);
21522152
Py_DECREF(type);
21532153
PyObject *helpful_msg = PyUnicode_FromFormat(
2154-
"%S - Consider hexidecimal for huge integer literals "
2154+
"%S - Consider hexadecimal for huge integer literals "
21552155
"to avoid decimal conversion limits.",
21562156
value);
21572157
if (helpful_msg) {

0 commit comments

Comments
 (0)