[Python-checkins] [3.9] Fix typos in the Lib directory (GH-28775) (GH-28803)

miss-islington webhook-mailer at python.org
Thu Oct 7 11:42:48 EDT 2021


https://github.com/python/cpython/commit/4346b81cc60ee23e0ae175300822615bd7d16431
commit: 4346b81cc60ee23e0ae175300822615bd7d16431
branch: 3.9
author: Christian Clauss <cclauss at me.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2021-10-07T08:42:38-07:00
summary:

[3.9] Fix typos in the Lib directory (GH-28775) (GH-28803)



Fix typos in the Lib directory as identified by codespell.

Co-authored-by: Terry Jan Reedy <tjreedy at udel.edu>
(cherry picked from commit 745c9d9dfc1ad6fdfdf1d07420c6273ff67fa5be)

Automerge-Triggered-By: GH:JulienPalard

files:
M Lib/asyncio/events.py
M Lib/asyncio/unix_events.py
M Lib/ctypes/_aix.py
M Lib/ctypes/test/test_structures.py
M Lib/difflib.py
M Lib/distutils/ccompiler.py
M Lib/html/parser.py
M Lib/idlelib/ChangeLog
M Lib/idlelib/idle_test/htest.py
M Lib/idlelib/idle_test/mock_tk.py
M Lib/idlelib/idle_test/test_multicall.py
M Lib/idlelib/idle_test/test_pyparse.py
M Lib/lib2to3/fixes/fix_metaclass.py
M Lib/lib2to3/fixes/fix_paren.py
M Lib/linecache.py
M Lib/pickle.py
M Lib/sqlite3/test/dbapi.py
M Lib/test/datetimetester.py
M Lib/test/decimaltestdata/abs.decTest
M Lib/test/decimaltestdata/extra.decTest
M Lib/test/libregrtest/refleak.py
M Lib/test/pickletester.py
M Lib/test/test__xxsubinterpreters.py
M Lib/test/test_asyncio/test_streams.py
M Lib/test/test_asyncio/test_subprocess.py
M Lib/test/test_asyncio/test_tasks.py
M Lib/test/test_collections.py
M Lib/test/test_descr.py
M Lib/test/test_dict.py
M Lib/test/test_dict_version.py
M Lib/test/test_dtrace.py
M Lib/test/test_email/test_message.py
M Lib/test/test_embed.py
M Lib/test/test_future.py
M Lib/test/test_lltrace.py
M Lib/test/test_locale.py
M Lib/test/test_pathlib.py
M Lib/test/test_strftime.py
M Lib/test/test_sys.py
M Lib/test/test_time.py
M Lib/test/test_unparse.py
M Lib/test/test_weakref.py
M Lib/test/test_wsgiref.py
M Lib/test/test_xml_etree.py
M Lib/test/test_xmlrpc.py
M Lib/threading.py
M Lib/tkinter/__init__.py
M Lib/tkinter/test/test_ttk/test_widgets.py
M Lib/unittest/async_case.py
M Lib/unittest/test/testmock/testsealable.py
M Lib/venv/scripts/common/Activate.ps1
M Lib/wsgiref/validate.py
M Lib/zoneinfo/_zoneinfo.py

diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py
index 0dce87b8ecc58..c8e4b407b476d 100644
--- a/Lib/asyncio/events.py
+++ b/Lib/asyncio/events.py
@@ -465,7 +465,7 @@ async def connect_read_pipe(self, protocol_factory, pipe):
         # The reason to accept file-like object instead of just file descriptor
         # is: we need to own pipe and close it at transport finishing
         # Can got complicated errors if pass f.fileno(),
-        # close fd in pipe transport then close f and vise versa.
+        # close fd in pipe transport then close f and vice versa.
         raise NotImplementedError
 
     async def connect_write_pipe(self, protocol_factory, pipe):
@@ -478,7 +478,7 @@ async def connect_write_pipe(self, protocol_factory, pipe):
         # The reason to accept file-like object instead of just file descriptor
         # is: we need to own pipe and close it at transport finishing
         # Can got complicated errors if pass f.fileno(),
-        # close fd in pipe transport then close f and vise versa.
+        # close fd in pipe transport then close f and vice versa.
         raise NotImplementedError
 
     async def subprocess_shell(self, protocol_factory, cmd, *,
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py
index 56fcc084e311f..9ab5dba272fd1 100644
--- a/Lib/asyncio/unix_events.py
+++ b/Lib/asyncio/unix_events.py
@@ -1383,7 +1383,7 @@ def add_child_handler(self, pid, callback, *args):
     def remove_child_handler(self, pid):
         # asyncio never calls remove_child_handler() !!!
         # The method is no-op but is implemented because
-        # abstract base classe requires it
+        # abstract base classes requires it
         return True
 
     def attach_loop(self, loop):
diff --git a/Lib/ctypes/_aix.py b/Lib/ctypes/_aix.py
index 26959d90a4dd6..fc3e95cbcc88a 100644
--- a/Lib/ctypes/_aix.py
+++ b/Lib/ctypes/_aix.py
@@ -163,7 +163,7 @@ def get_legacy(members):
             return member
     else:
         # 32-bit legacy names - both shr.o and shr4.o exist.
-        # shr.o is the preffered name so we look for shr.o first
+        # shr.o is the preferred name so we look for shr.o first
         #  i.e., shr4.o is returned only when shr.o does not exist
         for name in ['shr.o', 'shr4.o']:
             member = get_one_match(re.escape(name), members)
diff --git a/Lib/ctypes/test/test_structures.py b/Lib/ctypes/test/test_structures.py
index 245cd94c5cdd9..97ad2b8ed8a50 100644
--- a/Lib/ctypes/test/test_structures.py
+++ b/Lib/ctypes/test/test_structures.py
@@ -443,7 +443,7 @@ def __del__(self):
 
         s = Test(1, 2, 3)
         # Test the StructUnionType_paramfunc() code path which copies the
-        # structure: if the stucture is larger than sizeof(void*).
+        # structure: if the structure is larger than sizeof(void*).
         self.assertGreater(sizeof(s), sizeof(c_void_p))
 
         dll = CDLL(_ctypes_test.__file__)
@@ -451,7 +451,7 @@ def __del__(self):
         func.argtypes = (Test,)
         func.restype = None
         func(s)
-        # bpo-37140: Passing the structure by refrence must not call
+        # bpo-37140: Passing the structure by reference must not call
         # its finalizer!
         self.assertEqual(finalizer_calls, [])
         self.assertEqual(s.first, 1)
diff --git a/Lib/difflib.py b/Lib/difflib.py
index 480bad2224c8e..afd8a0c7c5b61 100644
--- a/Lib/difflib.py
+++ b/Lib/difflib.py
@@ -62,7 +62,7 @@ class SequenceMatcher:
     notion, pairing up elements that appear uniquely in each sequence.
     That, and the method here, appear to yield more intuitive difference
     reports than does diff.  This method appears to be the least vulnerable
-    to synching up on blocks of "junk lines", though (like blank lines in
+    to syncing up on blocks of "junk lines", though (like blank lines in
     ordinary text files, or maybe "<P>" lines in HTML files).  That may be
     because this is the only method of the 3 that has a *concept* of
     "junk" <wink>.
diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py
index b5ef143e72c56..4c47f2ed245d4 100644
--- a/Lib/distutils/ccompiler.py
+++ b/Lib/distutils/ccompiler.py
@@ -392,7 +392,7 @@ def _fix_compile_args(self, output_dir, macros, include_dirs):
         return output_dir, macros, include_dirs
 
     def _prep_compile(self, sources, output_dir, depends=None):
-        """Decide which souce files must be recompiled.
+        """Decide which source files must be recompiled.
 
         Determine the list of object files corresponding to 'sources',
         and figure out which ones really need to be recompiled.
diff --git a/Lib/html/parser.py b/Lib/html/parser.py
index 9e49effca1fcc..58f6bb3b1e932 100644
--- a/Lib/html/parser.py
+++ b/Lib/html/parser.py
@@ -405,7 +405,7 @@ def parse_endtag(self, i):
             tagname = namematch.group(1).lower()
             # consume and ignore other stuff between the name and the >
             # Note: this is not 100% correct, since we might have things like
-            # </tag attr=">">, but looking for > after tha name should cover
+            # </tag attr=">">, but looking for > after the name should cover
             # most of the cases and is much simpler
             gtpos = rawdata.find('>', namematch.end())
             self.handle_endtag(tagname)
diff --git a/Lib/idlelib/ChangeLog b/Lib/idlelib/ChangeLog
index d7d7e1efdb1d3..c8960cfa535d0 100644
--- a/Lib/idlelib/ChangeLog
+++ b/Lib/idlelib/ChangeLog
@@ -1175,7 +1175,7 @@ Wed Mar 10 05:18:02 1999  Guido van Rossum  <guido at cnri.reston.va.us>
 	    classes in selected module
 	    methods of selected class
 
-	Sinlge clicking in a directory, module or class item updates the next
+	Single clicking in a directory, module or class item updates the next
 	column with info about the selected item.  Double clicking in a
 	module, class or method item opens the file (and selects the clicked
 	item if it is a class or method).
diff --git a/Lib/idlelib/idle_test/htest.py b/Lib/idlelib/idle_test/htest.py
index 1373b7642a6ea..666ff4cb84851 100644
--- a/Lib/idlelib/idle_test/htest.py
+++ b/Lib/idlelib/idle_test/htest.py
@@ -246,7 +246,7 @@ def _wrapper(parent):  # htest #
 _object_browser_spec = {
     'file': 'debugobj',
     'kwds': {},
-    'msg': "Double click on items upto the lowest level.\n"
+    'msg': "Double click on items up to the lowest level.\n"
            "Attributes of the objects and related information "
            "will be displayed side-by-side at each level."
     }
@@ -255,7 +255,7 @@ def _wrapper(parent):  # htest #
     'file': 'pathbrowser',
     'kwds': {},
     'msg': "Test for correct display of all paths in sys.path.\n"
-           "Toggle nested items upto the lowest level.\n"
+           "Toggle nested items up to the lowest level.\n"
            "Double clicking on an item prints a traceback\n"
            "for an exception that is ignored."
     }
@@ -341,7 +341,7 @@ def _wrapper(parent):  # htest #
     'file': 'tree',
     'kwds': {},
     'msg': "The canvas is scrollable.\n"
-           "Click on folders upto to the lowest level."
+           "Click on folders up to to the lowest level."
     }
 
 _undo_delegator_spec = {
diff --git a/Lib/idlelib/idle_test/mock_tk.py b/Lib/idlelib/idle_test/mock_tk.py
index db583553838fb..8304734b847a8 100644
--- a/Lib/idlelib/idle_test/mock_tk.py
+++ b/Lib/idlelib/idle_test/mock_tk.py
@@ -79,7 +79,7 @@ def tearDownClass(cls):
     ---
     For 'ask' functions, set func.result return value before calling the method
     that uses the message function. When messagebox functions are the
-    only gui alls in a method, this replacement makes the method gui-free,
+    only GUI calls in a method, this replacement makes the method GUI-free,
     """
     askokcancel = Mbox_func()     # True or False
     askquestion = Mbox_func()     # 'yes' or 'no'
diff --git a/Lib/idlelib/idle_test/test_multicall.py b/Lib/idlelib/idle_test/test_multicall.py
index ba582bb3ca51b..b3a3bfb88f9c3 100644
--- a/Lib/idlelib/idle_test/test_multicall.py
+++ b/Lib/idlelib/idle_test/test_multicall.py
@@ -37,7 +37,7 @@ def test_init(self):
 
     def test_yview(self):
         # Added for tree.wheel_event
-        # (it depends on yview to not be overriden)
+        # (it depends on yview to not be overridden)
         mc = self.mc
         self.assertIs(mc.yview, Text.yview)
         mctext = self.mc(self.root)
diff --git a/Lib/idlelib/idle_test/test_pyparse.py b/Lib/idlelib/idle_test/test_pyparse.py
index fb5726db1d821..384db566ac76c 100644
--- a/Lib/idlelib/idle_test/test_pyparse.py
+++ b/Lib/idlelib/idle_test/test_pyparse.py
@@ -284,7 +284,7 @@ def test_get_num_lines_in_stmt(self):
         tests = (
             TestInfo('[x for x in a]\n', 1),      # Closed on one line.
             TestInfo('[x\nfor x in a\n', 2),      # Not closed.
-            TestInfo('[x\\\nfor x in a\\\n', 2),  # "", uneeded backslashes.
+            TestInfo('[x\\\nfor x in a\\\n', 2),  # "", unneeded backslashes.
             TestInfo('[x\nfor x in a\n]\n', 3),   # Closed on multi-line.
             TestInfo('\n"""Docstring comment L1"""\nL2\nL3\nL4\n', 1),
             TestInfo('\n"""Docstring comment L1\nL2"""\nL3\nL4\n', 1),
diff --git a/Lib/lib2to3/fixes/fix_metaclass.py b/Lib/lib2to3/fixes/fix_metaclass.py
index d1cd10d327587..fe547b2228072 100644
--- a/Lib/lib2to3/fixes/fix_metaclass.py
+++ b/Lib/lib2to3/fixes/fix_metaclass.py
@@ -51,7 +51,7 @@ def fixup_parse_tree(cls_node):
             # already in the preferred format, do nothing
             return
 
-    # !%@#! oneliners have no suite node, we have to fake one up
+    # !%@#! one-liners have no suite node, we have to fake one up
     for i, node in enumerate(cls_node.children):
         if node.type == token.COLON:
             break
diff --git a/Lib/lib2to3/fixes/fix_paren.py b/Lib/lib2to3/fixes/fix_paren.py
index b205aa7e1e93f..df3da5f5232c9 100644
--- a/Lib/lib2to3/fixes/fix_paren.py
+++ b/Lib/lib2to3/fixes/fix_paren.py
@@ -1,4 +1,4 @@
-"""Fixer that addes parentheses where they are required
+"""Fixer that adds parentheses where they are required
 
 This converts ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``."""
 
diff --git a/Lib/linecache.py b/Lib/linecache.py
index fa5dbd09eab86..921bfa039bd48 100644
--- a/Lib/linecache.py
+++ b/Lib/linecache.py
@@ -154,7 +154,7 @@ def lazycache(filename, module_globals):
 
     :return: True if a lazy load is registered in the cache,
         otherwise False. To register such a load a module loader with a
-        get_source method must be found, the filename must be a cachable
+        get_source method must be found, the filename must be a cacheable
         filename, and the filename must not be already cached.
     """
     if filename in cache:
diff --git a/Lib/pickle.py b/Lib/pickle.py
index e63a8b6e4dbb7..3d2c75a853889 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -1172,7 +1172,7 @@ def __init__(self, file, *, fix_imports=True,
         used in Python 3.  The *encoding* and *errors* tell pickle how
         to decode 8-bit string instances pickled by Python 2; these
         default to 'ASCII' and 'strict', respectively. *encoding* can be
-        'bytes' to read theses 8-bit string instances as bytes objects.
+        'bytes' to read these 8-bit string instances as bytes objects.
         """
         self._buffers = iter(buffers) if buffers is not None else None
         self._file_readline = file.readline
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py
index d00b60cac4e38..053543c0536f9 100644
--- a/Lib/sqlite3/test/dbapi.py
+++ b/Lib/sqlite3/test/dbapi.py
@@ -1,7 +1,7 @@
 #-*- coding: iso-8859-1 -*-
 # pysqlite2/test/dbapi.py: tests for DB-API compliance
 #
-# Copyright (C) 2004-2010 Gerhard Häring <gh at ghaering.de>
+# Copyright (C) 2004-2010 Gerhard Häring <gh at ghaering.de>
 #
 # This file is part of pysqlite.
 #
@@ -451,7 +451,7 @@ def CheckFetchoneNoStatement(self):
         self.assertEqual(row, None)
 
     def CheckArraySize(self):
-        # must default ot 1
+        # must default to 1
         self.assertEqual(self.cu.arraysize, 1)
 
         # now set to 2
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index fcc13bfc59667..85241526739cb 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -4064,7 +4064,7 @@ def test_even_more_compare(self):
         self.assertEqual(t1, t1)
         self.assertEqual(t2, t2)
 
-        # Equal afer adjustment.
+        # Equal after adjustment.
         t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""))
         t2 = self.theclass(2, 1, 1, 3, 13, tzinfo=FixedOffset(3*60+13+2, ""))
         self.assertEqual(t1, t2)
@@ -4903,7 +4903,7 @@ def test_easy(self):
         # OTOH, these fail!  Don't enable them.  The difficulty is that
         # the edge case tests assume that every hour is representable in
         # the "utc" class.  This is always true for a fixed-offset tzinfo
-        # class (lke utc_real and utc_fake), but not for Eastern or Central.
+        # class (like utc_real and utc_fake), but not for Eastern or Central.
         # For these adjacent DST-aware time zones, the range of time offsets
         # tested ends up creating hours in the one that aren't representable
         # in the other.  For the same reason, we would see failures in the
diff --git a/Lib/test/decimaltestdata/abs.decTest b/Lib/test/decimaltestdata/abs.decTest
index 01f73d7766648..569b8fcd84ab6 100644
--- a/Lib/test/decimaltestdata/abs.decTest
+++ b/Lib/test/decimaltestdata/abs.decTest
@@ -20,7 +20,7 @@
 version: 2.59
 
 -- This set of tests primarily tests the existence of the operator.
--- Additon, subtraction, rounding, and more overflows are tested
+-- Addition, subtraction, rounding, and more overflows are tested
 -- elsewhere.
 
 precision:   9
diff --git a/Lib/test/decimaltestdata/extra.decTest b/Lib/test/decimaltestdata/extra.decTest
index b630d8e3f9d45..31291202a35e7 100644
--- a/Lib/test/decimaltestdata/extra.decTest
+++ b/Lib/test/decimaltestdata/extra.decTest
@@ -156,7 +156,7 @@ extr1302 fma -Inf 0E-456 sNaN148 -> NaN Invalid_operation
 
 -- max/min/max_mag/min_mag bug in 2.5.2/2.6/3.0: max(NaN, finite) gave
 -- incorrect answers when the finite number required rounding; similarly
--- for the other thre functions
+-- for the other three functions
 maxexponent: 999
 minexponent: -999
 precision: 6
diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py
index 8d221232eb6ce..061204114d275 100644
--- a/Lib/test/libregrtest/refleak.py
+++ b/Lib/test/libregrtest/refleak.py
@@ -109,7 +109,7 @@ def get_pooled_int(value):
 
     # These checkers return False on success, True on failure
     def check_rc_deltas(deltas):
-        # Checker for reference counters and memomry blocks.
+        # Checker for reference counters and memory blocks.
         #
         # bpo-30776: Try to ignore false positives:
         #
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index a4ce5cebaebbb..e86847c5f13d8 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -3711,7 +3711,7 @@ class MyClass:
 
                 self.assertEqual(new_f, 5)
                 self.assertEqual(some_str, 'some str')
-                # math.log does not have its usual reducer overriden, so the
+                # math.log does not have its usual reducer overridden, so the
                 # custom reduction callback should silently direct the pickler
                 # to the default pickling by attribute, by returning
                 # NotImplemented
@@ -3728,7 +3728,7 @@ class MyClass:
     def test_reducer_override_no_reference_cycle(self):
         # bpo-39492: reducer_override used to induce a spurious reference cycle
         # inside the Pickler object, that could prevent all serialized objects
-        # from being garbage-collected without explicity invoking gc.collect.
+        # from being garbage-collected without explicitly invoking gc.collect.
 
         for proto in range(0, pickle.HIGHEST_PROTOCOL + 1):
             with self.subTest(proto=proto):
diff --git a/Lib/test/test__xxsubinterpreters.py b/Lib/test/test__xxsubinterpreters.py
index cbfa881818bc6..6260d0937eec8 100644
--- a/Lib/test/test__xxsubinterpreters.py
+++ b/Lib/test/test__xxsubinterpreters.py
@@ -1231,7 +1231,7 @@ def test_channel_list_interpreters_basic(self):
             import _xxsubinterpreters as _interpreters
             obj = _interpreters.channel_recv({cid})
             """))
-        # Test for channel that has boths ends associated to an interpreter.
+        # Test for channel that has both ends associated to an interpreter.
         send_interps = interpreters.channel_list_interpreters(cid, send=True)
         recv_interps = interpreters.channel_list_interpreters(cid, send=False)
         self.assertEqual(send_interps, [interp0])
diff --git a/Lib/test/test_asyncio/test_streams.py b/Lib/test/test_asyncio/test_streams.py
index 71de82dfc7ebb..38f4d84d4755f 100644
--- a/Lib/test/test_asyncio/test_streams.py
+++ b/Lib/test/test_asyncio/test_streams.py
@@ -736,7 +736,7 @@ def test_read_all_from_pipe_reader(self):
         # See asyncio issue 168.  This test is derived from the example
         # subprocess_attach_read_pipe.py, but we configure the
         # StreamReader's limit so that twice it is less than the size
-        # of the data writter.  Also we must explicitly attach a child
+        # of the data writer.  Also we must explicitly attach a child
         # watcher to the event loop.
 
         code = """\
diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py
index 693cc41290430..3f6fc15b278b8 100644
--- a/Lib/test/test_asyncio/test_subprocess.py
+++ b/Lib/test/test_asyncio/test_subprocess.py
@@ -227,7 +227,7 @@ def prepare_broken_pipe_test(self):
         # buffer large enough to feed the whole pipe buffer
         large_data = b'x' * support.PIPE_MAX_SIZE
 
-        # the program ends before the stdin can be feeded
+        # the program ends before the stdin can be fed
         proc = self.loop.run_until_complete(
             asyncio.create_subprocess_exec(
                 sys.executable, '-c', 'pass',
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
index e25c0a697fa18..402edaec0d8f9 100644
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -3568,7 +3568,7 @@ def test_run_coroutine_threadsafe_with_timeout(self):
             self.assertTrue(task.done())
 
     def test_run_coroutine_threadsafe_task_cancelled(self):
-        """Test coroutine submission from a tread to an event loop
+        """Test coroutine submission from a thread to an event loop
         when the task is cancelled."""
         callback = lambda: self.target(cancel=True)
         future = self.loop.run_in_executor(None, callback)
@@ -3576,7 +3576,7 @@ def test_run_coroutine_threadsafe_task_cancelled(self):
             self.loop.run_until_complete(future)
 
     def test_run_coroutine_threadsafe_task_factory_exception(self):
-        """Test coroutine submission from a tread to an event loop
+        """Test coroutine submission from a thread to an event loop
         when the task factory raise an exception."""
 
         def task_factory(loop, coro):
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 4ae9748e8eafe..9e1174743591c 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -1584,7 +1584,7 @@ def assertSameSet(self, s1, s2):
         self.assertSetEqual(set(s1), set(s2))
 
     def test_Set_from_iterable(self):
-        """Verify _from_iterable overriden to an instance method works."""
+        """Verify _from_iterable overridden to an instance method works."""
         class SetUsingInstanceFromIterable(MutableSet):
             def __init__(self, values, created_by):
                 if not created_by:
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 2fa68b201172f..0e6a784c6c14b 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -5672,7 +5672,7 @@ class A(metaclass=M):
 
     def test_incomplete_super(self):
         """
-        Attrubute lookup on a super object must be aware that
+        Attribute lookup on a super object must be aware that
         its target type can be uninitialized (type->tp_mro == NULL).
         """
         class M(DebugHelperMeta):
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
index b10c07534ddb2..d05ed302ede84 100644
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -1021,7 +1021,7 @@ def test_splittable_pop(self):
 
     @support.cpython_only
     def test_splittable_pop_pending(self):
-        """pop a pending key in a splitted table should not crash"""
+        """pop a pending key in a split table should not crash"""
         a, b = self.make_shared_key_dict(2)
 
         a['a'] = 4
@@ -1368,7 +1368,7 @@ def test_reversed(self):
         self.assertRaises(StopIteration, next, r)
 
     def test_reverse_iterator_for_empty_dict(self):
-        # bpo-38525: revered iterator should work properly
+        # bpo-38525: reversed iterator should work properly
 
         # empty dict is directly used for reference count test
         self.assertEqual(list(reversed({})), [])
diff --git a/Lib/test/test_dict_version.py b/Lib/test/test_dict_version.py
index b23786514f82e..95a42d03e6850 100644
--- a/Lib/test/test_dict_version.py
+++ b/Lib/test/test_dict_version.py
@@ -1,5 +1,5 @@
 """
-Test implementation of the PEP 509: dictionary versionning.
+Test implementation of the PEP 509: dictionary versioning.
 """
 import unittest
 from test import support
diff --git a/Lib/test/test_dtrace.py b/Lib/test/test_dtrace.py
index 1db73cc2d2220..3957077f5d612 100644
--- a/Lib/test/test_dtrace.py
+++ b/Lib/test/test_dtrace.py
@@ -34,7 +34,7 @@ def normalize_trace_output(output):
         return "\n".join(result)
     except (IndexError, ValueError):
         raise AssertionError(
-            "tracer produced unparseable output:\n{}".format(output)
+            "tracer produced unparsable output:\n{}".format(output)
         )
 
 
diff --git a/Lib/test/test_email/test_message.py b/Lib/test/test_email/test_message.py
index 920a3d6a9cb91..4c754bf40fc30 100644
--- a/Lib/test/test_email/test_message.py
+++ b/Lib/test/test_email/test_message.py
@@ -433,7 +433,7 @@ class TestEmailMessageBase:
                 --===
                 Content-Type: text/plain
 
-                Your message has bounced, ser.
+                Your message has bounced, sir.
 
                 --===
                 Content-Type: message/rfc822
diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py
index cc59bf4c859d1..11c8f012896d3 100644
--- a/Lib/test/test_embed.py
+++ b/Lib/test/test_embed.py
@@ -247,7 +247,7 @@ def test_forced_io_encoding(self):
 
     def test_pre_initialization_api(self):
         """
-        Checks some key parts of the C-API that need to work before the runtine
+        Checks some key parts of the C-API that need to work before the runtime
         is initialized (via Py_Initialize()).
         """
         env = dict(os.environ, PYTHONPATH=os.pathsep.join(sys.path))
@@ -1106,7 +1106,7 @@ def test_init_setpath_config(self):
             'base_prefix': '',
             'exec_prefix': '',
             'base_exec_prefix': '',
-            # overriden by PyConfig
+            # overridden by PyConfig
             'program_name': 'conf_program_name',
             'base_executable': 'conf_executable',
             'executable': 'conf_executable',
diff --git a/Lib/test/test_future.py b/Lib/test/test_future.py
index 0f40357b3a731..afef14c460b69 100644
--- a/Lib/test/test_future.py
+++ b/Lib/test/test_future.py
@@ -322,7 +322,7 @@ def test_annotations(self):
 
     def test_fstring_debug_annotations(self):
         # f-strings with '=' don't round trip very well, so set the expected
-        # result explicitely.
+        # result explicitly.
         self.assertAnnotationEqual("f'{x=!r}'", expected="f'x={x!r}'")
         self.assertAnnotationEqual("f'{x=:}'", expected="f'x={x:}'")
         self.assertAnnotationEqual("f'{x=:.2f}'", expected="f'x={x:.2f}'")
diff --git a/Lib/test/test_lltrace.py b/Lib/test/test_lltrace.py
index 49fae81eefab9..e366966117952 100644
--- a/Lib/test/test_lltrace.py
+++ b/Lib/test/test_lltrace.py
@@ -12,7 +12,7 @@ def test_lltrace_does_not_crash_on_subscript_operator(self):
         # If this test fails, it will reproduce a crash reported as
         # bpo-34113. The crash happened at the command line console of
         # debug Python builds with __ltrace__ enabled (only possible in console),
-        # when the interal Python stack was negatively adjusted
+        # when the internal Python stack was negatively adjusted
         with open(support.TESTFN, 'w') as fd:
             self.addCleanup(os.unlink, support.TESTFN)
             fd.write(textwrap.dedent("""\
diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py
index 375a1e4028631..a63cc0d9cc86e 100644
--- a/Lib/test/test_locale.py
+++ b/Lib/test/test_locale.py
@@ -494,7 +494,7 @@ def test_japanese(self):
 class TestMiscellaneous(unittest.TestCase):
     def test_defaults_UTF8(self):
         # Issue #18378: on (at least) macOS setting LC_CTYPE to "UTF-8" is
-        # valid. Futhermore LC_CTYPE=UTF is used by the UTF-8 locale coercing
+        # valid. Furthermore LC_CTYPE=UTF is used by the UTF-8 locale coercing
         # during interpreter startup (on macOS).
         import _locale
         import os
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
index 0314938e30c14..183c157afdcd0 100644
--- a/Lib/test/test_pathlib.py
+++ b/Lib/test/test_pathlib.py
@@ -323,7 +323,7 @@ def test_match_common(self):
         self.assertFalse(P('b/py').match('b.py'))
         self.assertFalse(P('/a.py').match('b.py'))
         self.assertFalse(P('b.py/c').match('b.py'))
-        # Wilcard relative pattern.
+        # Wildcard relative pattern.
         self.assertTrue(P('b.py').match('*.py'))
         self.assertTrue(P('a/b.py').match('*.py'))
         self.assertTrue(P('/a/b.py').match('*.py'))
@@ -1250,7 +1250,7 @@ def test_is_reserved(self):
         self.assertIs(False, P('/foo/bar').is_reserved())
         # UNC paths are never reserved.
         self.assertIs(False, P('//my/share/nul/con/aux').is_reserved())
-        # Case-insenstive DOS-device names are reserved.
+        # Case-insensitive DOS-device names are reserved.
         self.assertIs(True, P('nul').is_reserved())
         self.assertIs(True, P('aux').is_reserved())
         self.assertIs(True, P('prn').is_reserved())
diff --git a/Lib/test/test_strftime.py b/Lib/test/test_strftime.py
index ec305e54ff24f..be43c49e40aa5 100644
--- a/Lib/test/test_strftime.py
+++ b/Lib/test/test_strftime.py
@@ -114,7 +114,7 @@ def strftest1(self, now):
         )
 
         for e in expectations:
-            # musn't raise a value error
+            # mustn't raise a value error
             try:
                 result = time.strftime(e[0], now)
             except ValueError as error:
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index f277c92c408d5..450e3920efa7c 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -409,7 +409,7 @@ def g456():
         self.assertTrue(frame is sys._getframe())
 
         # Verify that the captured thread frame is blocked in g456, called
-        # from f123.  This is a litte tricky, since various bits of
+        # from f123.  This is a little tricky, since various bits of
         # threading.py are also in the thread's call stack.
         frame = d.pop(thread_id)
         stack = traceback.extract_stack(frame)
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index 6674edc21e9df..90a123828b709 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -435,8 +435,8 @@ def test_mktime(self):
     @unittest.skipUnless(platform.libc_ver()[0] != 'glibc',
                          "disabled because of a bug in glibc. Issue #13309")
     def test_mktime_error(self):
-        # It may not be possible to reliably make mktime return error
-        # on all platfom.  This will make sure that no other exception
+        # It may not be possible to reliably make mktime return an error
+        # on all platforms.  This will make sure that no other exception
         # than OverflowError is raised for an extreme value.
         tt = time.gmtime(self.t)
         tzname = time.strftime('%Z', tt)
diff --git a/Lib/test/test_unparse.py b/Lib/test/test_unparse.py
index ce03272ad30b2..d7587836aa8a3 100644
--- a/Lib/test/test_unparse.py
+++ b/Lib/test/test_unparse.py
@@ -408,7 +408,7 @@ def test_type_ignore(self):
 
 
 class CosmeticTestCase(ASTTestCase):
-    """Test if there are cosmetic issues caused by unnecesary additions"""
+    """Test if there are cosmetic issues caused by unnecessary additions"""
 
     def test_simple_expressions_parens(self):
         self.check_src_roundtrip("(a := b)")
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index 5a3e59c3e9ef1..096833d1ebb35 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -1472,7 +1472,7 @@ def check_weak_del_and_len_while_iterating(self, dict, testcontext):
         o = Object(123456)
         with testcontext():
             n = len(dict)
-            # Since underlaying dict is ordered, first item is popped
+            # Since underlying dict is ordered, first item is popped
             dict.pop(next(dict.keys()))
             self.assertEqual(len(dict), n - 1)
             dict[o] = o
diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py
index 4bf5d39e619f6..3e76e01c653f3 100644
--- a/Lib/test/test_wsgiref.py
+++ b/Lib/test/test_wsgiref.py
@@ -579,7 +579,7 @@ def testEnviron(self):
         # Test handler.environ as a dict
         expected = {}
         setup_testing_defaults(expected)
-        # Handler inherits os_environ variables which are not overriden
+        # Handler inherits os_environ variables which are not overridden
         # by SimpleHandler.add_cgi_vars() (SimpleHandler.base_env)
         for key, value in os_environ.items():
             if key not in expected:
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index 15c462ce80836..23c4cd5eff0a9 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -3272,7 +3272,7 @@ class MyElement(ET.Element):
         self._check_element_factory_class(MyElement)
 
     def test_element_factory_pure_python_subclass(self):
-        # Mimick SimpleTAL's behaviour (issue #16089): both versions of
+        # Mimic SimpleTAL's behaviour (issue #16089): both versions of
         # TreeBuilder should be able to cope with a subclass of the
         # pure Python Element class.
         base = ET._Element_Py
diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py
index 83b618b749162..f714b773eeecc 100644
--- a/Lib/test/test_xmlrpc.py
+++ b/Lib/test/test_xmlrpc.py
@@ -559,7 +559,7 @@ def test_comparison(self):
 
 class BinaryTestCase(unittest.TestCase):
 
-    # XXX What should str(Binary(b"\xff")) return?  I'm chosing "\xff"
+    # XXX What should str(Binary(b"\xff")) return?  I'm choosing "\xff"
     # for now (i.e. interpreting the binary data as Latin-1-encoded
     # text).  But this feels very unsatisfactory.  Perhaps we should
     # only define repr(), and return r"Binary(b'\xff')" instead?
diff --git a/Lib/threading.py b/Lib/threading.py
index 0f2b9239ce399..a3cb245ab9606 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -1466,7 +1466,7 @@ def _shutdown():
             break
 
         for lock in locks:
-            # mimick Thread.join()
+            # mimic Thread.join()
             lock.acquire()
             lock.release()
 
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index f15f6c5e57a50..9049ca308f95a 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -2707,7 +2707,7 @@ def addtag_closest(self, newtag, x, y, halo=None, start=None):
         """Add tag NEWTAG to item which is closest to pixel at X, Y.
         If several match take the top-most.
         All items closer than HALO are considered overlapping (all are
-        closests). If START is specified the next below this tag is taken."""
+        closest). If START is specified the next below this tag is taken."""
         self.addtag(newtag, 'closest', x, y, halo, start)
 
     def addtag_enclosed(self, newtag, x1, y1, x2, y2):
@@ -3302,7 +3302,7 @@ def add_command(self, cnf={}, **kw):
         self.add('command', cnf or kw)
 
     def add_radiobutton(self, cnf={}, **kw):
-        """Addd radio menu item."""
+        """Add radio menu item."""
         self.add('radiobutton', cnf or kw)
 
     def add_separator(self, cnf={}, **kw):
@@ -3327,7 +3327,7 @@ def insert_command(self, index, cnf={}, **kw):
         self.insert(index, 'command', cnf or kw)
 
     def insert_radiobutton(self, index, cnf={}, **kw):
-        """Addd radio menu item at INDEX."""
+        """Add radio menu item at INDEX."""
         self.insert(index, 'radiobutton', cnf or kw)
 
     def insert_separator(self, index, cnf={}, **kw):
diff --git a/Lib/tkinter/test/test_ttk/test_widgets.py b/Lib/tkinter/test/test_ttk/test_widgets.py
index ee5af82fd1b44..082da5d0c1a00 100644
--- a/Lib/tkinter/test/test_ttk/test_widgets.py
+++ b/Lib/tkinter/test/test_ttk/test_widgets.py
@@ -968,7 +968,7 @@ def test_add_and_hidden(self):
         tabs = self.nb.tabs()
 
         curr = self.nb.index('current')
-        # verify that the tab gets readded at its previous position
+        # verify that the tab gets read at its previous position
         child2_index = self.nb.index(self.child2)
         self.nb.hide(self.child2)
         self.nb.add(self.child2)
diff --git a/Lib/unittest/async_case.py b/Lib/unittest/async_case.py
index 3938efa3d423f..22cb61b7211c6 100644
--- a/Lib/unittest/async_case.py
+++ b/Lib/unittest/async_case.py
@@ -52,7 +52,7 @@ def addAsyncCleanup(self, func, /, *args, **kwargs):
         # We intentionally don't add inspect.iscoroutinefunction() check
         # for func argument because there is no way
         # to check for async function reliably:
-        # 1. It can be "async def func()" iself
+        # 1. It can be "async def func()" itself
         # 2. Class can implement "async def __call__()" method
         # 3. Regular "def func()" that returns awaitable object
         self.addCleanup(*(func, *args), **kwargs)
diff --git a/Lib/unittest/test/testmock/testsealable.py b/Lib/unittest/test/testmock/testsealable.py
index 11784c3678918..daba2b49b46f6 100644
--- a/Lib/unittest/test/testmock/testsealable.py
+++ b/Lib/unittest/test/testmock/testsealable.py
@@ -128,7 +128,7 @@ def test_integration_with_spec_att_definition(self):
             m.attr_sample2
 
     def test_integration_with_spec_method_definition(self):
-        """You need to defin the methods, even if they are in the spec"""
+        """You need to define the methods, even if they are in the spec"""
         m = mock.Mock(SampleObject)
 
         m.method_sample1.return_value = 1
diff --git a/Lib/venv/scripts/common/Activate.ps1 b/Lib/venv/scripts/common/Activate.ps1
index a3bc6fb1f05bf..7bc3e7c698fc2 100644
--- a/Lib/venv/scripts/common/Activate.ps1
+++ b/Lib/venv/scripts/common/Activate.ps1
@@ -197,7 +197,7 @@ else {
         $Prompt = $pyvenvCfg['prompt'];
     }
     else {
-        Write-Verbose "  Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virutal environment)"
+        Write-Verbose "  Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)"
         Write-Verbose "  Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
         $Prompt = Split-Path -Path $venvDir -Leaf
     }
diff --git a/Lib/wsgiref/validate.py b/Lib/wsgiref/validate.py
index 48ac0070549b3..6e16578dbb648 100644
--- a/Lib/wsgiref/validate.py
+++ b/Lib/wsgiref/validate.py
@@ -137,7 +137,7 @@ def validator(application):
 
     """
     When applied between a WSGI server and a WSGI application, this
-    middleware will check for WSGI compliancy on a number of levels.
+    middleware will check for WSGI compliance on a number of levels.
     This middleware does not modify the request or response in any
     way, but will raise an AssertionError if anything seems off
     (except for a failure to close the application iterator, which
diff --git a/Lib/zoneinfo/_zoneinfo.py b/Lib/zoneinfo/_zoneinfo.py
index 9810637d3ef65..de68380792f17 100644
--- a/Lib/zoneinfo/_zoneinfo.py
+++ b/Lib/zoneinfo/_zoneinfo.py
@@ -338,7 +338,7 @@ def _utcoff_to_dstoff(trans_idx, utcoffsets, isdsts):
                 comp_idx = trans_idx[i + 1]
 
                 # If the following transition is also DST and we couldn't
-                # find the DST offset by this point, we're going ot have to
+                # find the DST offset by this point, we're going to have to
                 # skip it and hope this transition gets assigned later
                 if isdsts[comp_idx]:
                     continue



More information about the Python-checkins mailing list