Skip to content

Commit c4cacc8

Browse files
minho42terryjreedy
authored andcommitted
Fix typos in comments, docs and test names (#15018)
* Fix typos in comments, docs and test names * Update test_pyparse.py account for change in string length * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <[email protected]> * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <[email protected]> * Apply suggestion: Dealloccte -> Deallocate Co-Authored-By: Terry Jan Reedy <[email protected]> * Update posixmodule checksum. * Reverse idlelib changes.
1 parent 0acb646 commit c4cacc8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+73
-73
lines changed

Doc/library/email.encoders.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ the :meth:`~email.message.EmailMessage.set_content` method.
1515
This module is deprecated in Python 3. The functions provided here
1616
should not be called explicitly since the :class:`~email.mime.text.MIMEText`
1717
class sets the content type and CTE header using the *_subtype* and *_charset*
18-
values passed during the instaniation of that class.
18+
values passed during the instantiation of that class.
1919

2020
The remaining text in this section is the original documentation of the module.
2121

Doc/library/statistics.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ However, for reading convenience, most of the examples show sorted sequences.
554554
>>> [round(q, 1) for q in quantiles(data, n=10)]
555555
[81.0, 86.2, 89.0, 99.4, 102.5, 103.6, 106.0, 109.8, 111.0]
556556

557-
>>> # Quartile cut points for the standard normal distibution
557+
>>> # Quartile cut points for the standard normal distribution
558558
>>> Z = NormalDist()
559559
>>> [round(q, 4) for q in quantiles(Z, n=4)]
560560
[-0.6745, 0.0, 0.6745]

Include/abstract.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ PyAPI_FUNC(PyObject *) PySequence_Fast(PyObject *o, const char* m);
702702
(PyList_Check(o) ? PyList_GET_ITEM(o, i) : PyTuple_GET_ITEM(o, i))
703703

704704
/* Return a pointer to the underlying item array for
705-
an object retured by PySequence_Fast */
705+
an object returned by PySequence_Fast */
706706
#define PySequence_Fast_ITEMS(sf) \
707707
(PyList_Check(sf) ? ((PyListObject *)(sf))->ob_item \
708708
: ((PyTupleObject *)(sf))->ob_item)

Include/ast.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ PyAPI_FUNC(mod_ty) PyAST_FromNodeObject(
2525
PyAPI_FUNC(PyObject *) _PyAST_ExprAsUnicode(expr_ty);
2626

2727
/* Return the borrowed reference to the first literal string in the
28-
sequence of statemnts or NULL if it doesn't start from a literal string.
28+
sequence of statements or NULL if it doesn't start from a literal string.
2929
Doesn't set exception. */
3030
PyAPI_FUNC(PyObject *) _PyAST_GetDocString(asdl_seq *);
3131

Include/pymath.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ PyAPI_FUNC(void) _Py_set_387controlword(unsigned short);
125125

126126
/* Py_IS_FINITE(X)
127127
* Return 1 if float or double arg is neither infinite nor NAN, else 0.
128-
* Some compilers (e.g. VisualStudio) have intrisics for this, so a special
128+
* Some compilers (e.g. VisualStudio) have intrinsics for this, so a special
129129
* macro for this particular test is useful
130130
* Note: PC/pyconfig.h defines Py_IS_FINITE as _finite
131131
*/

Lib/_pyio.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,7 @@ def __init__(self, file, mode='r', closefd=True, opener=None):
15731573
raise IsADirectoryError(errno.EISDIR,
15741574
os.strerror(errno.EISDIR), file)
15751575
except AttributeError:
1576-
# Ignore the AttribueError if stat.S_ISDIR or errno.EISDIR
1576+
# Ignore the AttributeError if stat.S_ISDIR or errno.EISDIR
15771577
# don't exist.
15781578
pass
15791579
self._blksize = getattr(fdfstat, 'st_blksize', 0)

Lib/asyncio/streams.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ def __init__(self, loop=None, *, _asyncio_internal=False):
556556
# Avoid inheritance from FlowControlMixin
557557
# Copy-paste the code to your project
558558
# if you need flow control helpers
559-
warnings.warn(f"{self.__class__} should be instaniated "
559+
warnings.warn(f"{self.__class__} should be instantiated "
560560
"by asyncio internals only, "
561561
"please avoid its creation from user code",
562562
DeprecationWarning)

Lib/asyncio/subprocess.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def _get_close_waiter(self, stream):
130130
class Process:
131131
def __init__(self, transport, protocol, loop, *, _asyncio_internal=False):
132132
if not _asyncio_internal:
133-
warnings.warn(f"{self.__class__} should be instaniated "
133+
warnings.warn(f"{self.__class__} should be instantiated "
134134
"by asyncio internals only, "
135135
"please avoid its creation from user code",
136136
DeprecationWarning)

Lib/imaplib.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ def deleteacl(self, mailbox, who):
502502
def enable(self, capability):
503503
"""Send an RFC5161 enable string to the server.
504504
505-
(typ, [data]) = <intance>.enable(capability)
505+
(typ, [data]) = <instance>.enable(capability)
506506
"""
507507
if 'ENABLE' not in self.capabilities:
508508
raise IMAP4.error("Server does not support ENABLE")

Lib/lib2to3/fixer_util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def _find(name, node):
412412
return None
413413

414414
def _is_import_binding(node, name, package=None):
415-
""" Will reuturn node if node will import name, or node
415+
""" Will return node if node will import name, or node
416416
will import * from package. None is returned otherwise.
417417
See test cases for examples. """
418418

Lib/lib2to3/tests/test_parser.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ def test_4(self):
531531

532532
# Adapted from Python 3's Lib/test/test_unicode_identifiers.py and
533533
# Lib/test/test_tokenize.py:TokenizeTest.test_non_ascii_identifiers
534-
class TestIdentfier(GrammarTest):
534+
class TestIdentifier(GrammarTest):
535535
def test_non_ascii_identifiers(self):
536536
self.validate("Örter = 'places'\ngrün = 'green'")
537537
self.validate("蟒 = a蟒 = 锦蛇 = 1")

Lib/test/libregrtest/win_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
class WindowsLoadTracker():
1919
"""
2020
This class asynchronously interacts with the `typeperf` command to read
21-
the system load on Windows. Mulitprocessing and threads can't be used
21+
the system load on Windows. Multiprocessing and threads can't be used
2222
here because they interfere with the test suite's cases for those
2323
modules.
2424
"""

Lib/test/test_ast.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ def test_invalid_sum(self):
551551
compile(m, "<test>", "exec")
552552
self.assertIn("but got <_ast.expr", str(cm.exception))
553553

554-
def test_invalid_identitifer(self):
554+
def test_invalid_identifier(self):
555555
m = ast.Module([ast.Expr(ast.Name(42, ast.Load()))], [])
556556
ast.fix_missing_locations(m)
557557
with self.assertRaises(TypeError) as cm:

Lib/test/test_cmd_line_script.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ def test_consistent_sys_path_for_module_execution(self):
714714
def test_nonexisting_script(self):
715715
# bpo-34783: "./python script.py" must not crash
716716
# if the script file doesn't exist.
717-
# (Skip test for macOS framework builds because sys.excutable name
717+
# (Skip test for macOS framework builds because sys.executable name
718718
# is not the actual Python executable file name.
719719
script = 'nonexistingscript.py'
720720
self.assertFalse(os.path.exists(script))

Lib/test/test_collections.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,8 @@ def test_tupleness(self):
424424

425425
self.assertIsInstance(p, tuple)
426426
self.assertEqual(p, (11, 22)) # matches a real tuple
427-
self.assertEqual(tuple(p), (11, 22)) # coercable to a real tuple
428-
self.assertEqual(list(p), [11, 22]) # coercable to a list
427+
self.assertEqual(tuple(p), (11, 22)) # coercible to a real tuple
428+
self.assertEqual(list(p), [11, 22]) # coercible to a list
429429
self.assertEqual(max(p), 22) # iterable
430430
self.assertEqual(max(*p), 22) # star-able
431431
x, y = p

Lib/test/test_compileall.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -578,14 +578,14 @@ def test_workers_available_cores(self, compile_dir):
578578
self.assertEqual(compile_dir.call_args[-1]['workers'], 0)
579579

580580

581-
class CommmandLineTestsWithSourceEpoch(CommandLineTestsBase,
581+
class CommandLineTestsWithSourceEpoch(CommandLineTestsBase,
582582
unittest.TestCase,
583583
metaclass=SourceDateEpochTestMeta,
584584
source_date_epoch=True):
585585
pass
586586

587587

588-
class CommmandLineTestsNoSourceEpoch(CommandLineTestsBase,
588+
class CommandLineTestsNoSourceEpoch(CommandLineTestsBase,
589589
unittest.TestCase,
590590
metaclass=SourceDateEpochTestMeta,
591591
source_date_epoch=False):

Lib/test/test_doctest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2485,7 +2485,7 @@ def test_unittest_reportflags():
24852485

24862486
def test_testfile(): r"""
24872487
Tests for the `testfile()` function. This function runs all the
2488-
doctest examples in a given file. In its simple invokation, it is
2488+
doctest examples in a given file. In its simple invocation, it is
24892489
called with the name of a file, which is taken to be relative to the
24902490
calling module. The return value is (#failures, #tests).
24912491

Lib/test/test_email/test__header_value_parser.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def test_get_unstructured_ew_with_internal_leading_ws(self):
297297
[],
298298
'')
299299

300-
def test_get_unstructured_invaild_ew(self):
300+
def test_get_unstructured_invalid_ew(self):
301301
self._test_get_x(self._get_unst,
302302
'=?test val',
303303
'=?test val',

Lib/test/test_email/test_email.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ def test_last_split_chunk_does_not_fit(self):
10081008
Subject: the first part of this is short,
10091009
but_the_second_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself""")
10101010

1011-
def test_splittable_leading_char_followed_by_overlong_unsplitable(self):
1011+
def test_splittable_leading_char_followed_by_overlong_unsplittable(self):
10121012
eq = self.ndiffAssertEqual
10131013
h = Header(', but_the_second'
10141014
'_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line'
@@ -1017,7 +1017,7 @@ def test_splittable_leading_char_followed_by_overlong_unsplitable(self):
10171017
,
10181018
but_the_second_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself""")
10191019

1020-
def test_multiple_splittable_leading_char_followed_by_overlong_unsplitable(self):
1020+
def test_multiple_splittable_leading_char_followed_by_overlong_unsplittable(self):
10211021
eq = self.ndiffAssertEqual
10221022
h = Header(', , but_the_second'
10231023
'_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line'
@@ -1026,14 +1026,14 @@ def test_multiple_splittable_leading_char_followed_by_overlong_unsplitable(self)
10261026
, ,
10271027
but_the_second_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself""")
10281028

1029-
def test_trailing_splitable_on_overlong_unsplitable(self):
1029+
def test_trailing_splittable_on_overlong_unsplittable(self):
10301030
eq = self.ndiffAssertEqual
10311031
h = Header('this_part_does_not_fit_within_maxlinelen_and_thus_should_'
10321032
'be_on_a_line_all_by_itself;')
10331033
eq(h.encode(), "this_part_does_not_fit_within_maxlinelen_and_thus_should_"
10341034
"be_on_a_line_all_by_itself;")
10351035

1036-
def test_trailing_splitable_on_overlong_unsplitable_with_leading_splitable(self):
1036+
def test_trailing_splittable_on_overlong_unsplittable_with_leading_splittable(self):
10371037
eq = self.ndiffAssertEqual
10381038
h = Header('; '
10391039
'this_part_does_not_fit_within_maxlinelen_and_thus_should_'
@@ -1466,7 +1466,7 @@ def test_mangled_from_with_bad_bytes(self):
14661466
g.flatten(msg)
14671467
self.assertEqual(b.getvalue(), source + b'>From R\xc3\xb6lli\n')
14681468

1469-
def test_mutltipart_with_bad_bytes_in_cte(self):
1469+
def test_multipart_with_bad_bytes_in_cte(self):
14701470
# bpo30835
14711471
source = textwrap.dedent("""\
14721472

Lib/test/test_importlib/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ def test_absolute_path(self):
488488
self.execute(data01, full_path)
489489

490490
def test_relative_path(self):
491-
# A reative path is a ValueError.
491+
# A relative path is a ValueError.
492492
with self.assertRaises(ValueError):
493493
self.execute(data01, '../data01/utf-8.file')
494494

Lib/test/test_mailbox.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,7 @@ def test_initialize_incorrectly(self):
14201420
# Initialize with invalid argument
14211421
self.assertRaises(TypeError, lambda: self._factory(object()))
14221422

1423-
def test_all_eMM_attribues_exist(self):
1423+
def test_all_eMM_attributes_exist(self):
14241424
# Issue 12537
14251425
eMM = email.message_from_string(_sample_message)
14261426
msg = self._factory(_sample_message)

Lib/test/test_pdb.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ def test_pdb_return_command_for_coroutine():
983983

984984
def test_pdb_until_command_for_generator():
985985
"""Testing no unwindng stack on yield for generators
986-
for "until" command if target breakpoing is not reached
986+
for "until" command if target breakpoint is not reached
987987
988988
>>> def test_gen():
989989
... yield 0
@@ -1027,7 +1027,7 @@ def test_pdb_until_command_for_generator():
10271027

10281028
def test_pdb_until_command_for_coroutine():
10291029
"""Testing no unwindng stack for coroutines
1030-
for "until" command if target breakpoing is not reached
1030+
for "until" command if target breakpoint is not reached
10311031
10321032
>>> import asyncio
10331033

Lib/test/test_pprint.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ def test_set_of_sets_reprs(self):
481481
# Consequently, this test is fragile and
482482
# implementation-dependent. Small changes to Python's sort
483483
# algorithm cause the test to fail when it should pass.
484-
# XXX Or changes to the dictionary implmentation...
484+
# XXX Or changes to the dictionary implementation...
485485

486486
cube_repr_tgt = """\
487487
{frozenset(): frozenset({frozenset({2}), frozenset({0}), frozenset({1})}),

Lib/test/test_subprocess.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ def test_run_kwargs(self):
15001500
def test_run_with_pathlike_path(self):
15011501
# bpo-31961: test run(pathlike_object)
15021502
# the name of a command that can be run without
1503-
# any argumenets that exit fast
1503+
# any arguments that exit fast
15041504
prog = 'tree.com' if mswindows else 'ls'
15051505
path = shutil.which(prog)
15061506
if path is None:

Lib/test/test_threading.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def fail_new_thread(*args):
288288
finally:
289289
threading._start_new_thread = _start_new_thread
290290

291-
def test_finalize_runnning_thread(self):
291+
def test_finalize_running_thread(self):
292292
# Issue 1402: the PyGILState_Ensure / _Release functions may be called
293293
# very late on python exit: on deallocation of a running thread for
294294
# example.

Lib/test/test_trace.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def test_trace_list_comprehension(self):
180180
firstlineno_called = get_firstlineno(traced_doubler)
181181
expected = {
182182
(self.my_py_filename, firstlineno_calling + 1): 1,
183-
# List compehentions work differently in 3.x, so the count
183+
# List comprehensions work differently in 3.x, so the count
184184
# below changed compared to 2.x.
185185
(self.my_py_filename, firstlineno_calling + 2): 12,
186186
(self.my_py_filename, firstlineno_calling + 3): 1,

Lib/test/test_turtle.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def test_config_dict(self):
8585

8686
self.assertEqual(parsed_cfg, expected)
8787

88-
def test_partial_config_dict_with_commments(self):
88+
def test_partial_config_dict_with_comments(self):
8989

9090
cfg_name = self.get_cfg_file(test_config_two)
9191
parsed_cfg = turtle.config_dict(cfg_name)

Lib/test/test_types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ def test(f, format_spec, result):
466466

467467
# No format code means use g, but must have a decimal
468468
# and a number after the decimal. This is tricky, because
469-
# a totaly empty format specifier means something else.
469+
# a totally empty format specifier means something else.
470470
# So, just use a sign flag
471471
test(1e200, '+g', '+1e+200')
472472
test(1e200, '+', '+1e+200')

Lib/test/test_venv.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def test_multiprocessing(self):
345345
"""
346346
Test that the multiprocessing is able to spawn.
347347
"""
348-
# Issue bpo-36342: Instanciation of a Pool object imports the
348+
# Issue bpo-36342: Instantiation of a Pool object imports the
349349
# multiprocessing.synchronize module. Skip the test if this module
350350
# cannot be imported.
351351
import_module('multiprocessing.synchronize')

Lib/unittest/result.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def wasSuccessful(self):
161161
"""Tells whether or not this result was a success."""
162162
# The hasattr check is for test_result's OldResult test. That
163163
# way this method works on objects that lack the attribute.
164-
# (where would such result intances come from? old stored pickles?)
164+
# (where would such result instances come from? old stored pickles?)
165165
return ((len(self.failures) == len(self.errors) == 0) and
166166
(not hasattr(self, 'unexpectedSuccesses') or
167167
len(self.unexpectedSuccesses) == 0))

Lib/unittest/test/testmock/testmock.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def test_call(self):
262262

263263
ret_val = mock(sentinel.Arg)
264264
self.assertTrue(mock.called, "called not set")
265-
self.assertEqual(mock.call_count, 1, "call_count incoreect")
265+
self.assertEqual(mock.call_count, 1, "call_count incorrect")
266266
self.assertEqual(mock.call_args, ((sentinel.Arg,), {}),
267267
"call_args not set")
268268
self.assertEqual(mock.call_args.args, (sentinel.Arg,),

Misc/HISTORY

+1-1
Original file line numberDiff line numberDiff line change
@@ -2113,7 +2113,7 @@ Build
21132113
- Issue #21285: Refactor and fix curses configure check to always search
21142114
in a ncursesw directory.
21152115

2116-
- Issue #15234: For BerkelyDB and Sqlite, only add the found library and
2116+
- Issue #15234: For BerkeleyDB and Sqlite, only add the found library and
21172117
include directories if they aren't already being searched. This avoids
21182118
an explicit runtime library dependency.
21192119

Misc/NEWS.d/3.5.0a1.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4992,7 +4992,7 @@ directory.
49924992
.. nonce: vlM720
49934993
.. section: Build
49944994
4995-
For BerkelyDB and Sqlite, only add the found library and include directories
4995+
For BerkeleyDB and Sqlite, only add the found library and include directories
49964996
if they aren't already being searched. This avoids an explicit runtime
49974997
library dependency.
49984998

Misc/NEWS.d/3.7.0a1.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3067,7 +3067,7 @@ Sped up reading encrypted ZIP files by 2 times.
30673067
.. section: Library
30683068
30693069
Element.getiterator() and the html parameter of XMLParser() were deprecated
3070-
only in the documentation (since Python 3.2 and 3.4 correspondintly). Now
3070+
only in the documentation (since Python 3.2 and 3.4 correspondingly). Now
30713071
using them emits a deprecation warning.
30723072

30733073
..

Misc/NEWS.d/3.8.0a1.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2054,7 +2054,7 @@ Speed-up building enums by value, e.g. http.HTTPStatus(200).
20542054
.. section: Library
20552055
20562056
random.gammavariate(1.0, beta) now computes the same result as
2057-
random.expovariate(1.0 / beta). This synchonizes the two algorithms and
2057+
random.expovariate(1.0 / beta). This synchronizes the two algorithms and
20582058
eliminates some idiosyncrasies in the old implementation. It does however
20592059
produce a difference stream of random variables than it used to.
20602060

Misc/NEWS.d/3.8.0a4.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ only enabled by ``--findleaks``. The check now also works with
904904
.. nonce: B8-ghi
905905
.. section: Tests
906906
907-
When using mulitprocessing mode (-jN), regrtest now better reports errors if
907+
When using multiprocessing mode (-jN), regrtest now better reports errors if
908908
a worker process fails, and it exits immediately on a worker thread failure
909909
or when interrupted.
910910

Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Remove errorneous optimization for empty set differences.
1+
Remove erroneous optimization for empty set differences.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Adjust "Zoom Height" to individual screens by momemtarily maximizing the
1+
Adjust "Zoom Height" to individual screens by momentarily maximizing the
22
window on first use with a particular screen. Changing screen settings
33
may invalidate the saved height. While a window is maximized,
44
"Zoom Height" has no effect.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Fix an inifite loop when parsing specially crafted email headers. Patch by
1+
Fix an infinite loop when parsing specially crafted email headers. Patch by
22
Abhilash Raj.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
``test_venv.test_mutiprocessing()`` now explicitly calls
1+
``test_venv.test_multiprocessing()`` now explicitly calls
22
``pool.terminate()`` to wait until the pool completes.

0 commit comments

Comments
 (0)