Fix typos mostly in comments, docs and test names (GH-15209)

diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py
index e56e2ef..33b2fa5 100644
--- a/Lib/asyncio/streams.py
+++ b/Lib/asyncio/streams.py
@@ -71,7 +71,7 @@
             ssl_handshake_timeout=None,
             happy_eyeballs_delay=None, interleave=None):
     # Design note:
-    # Don't use decorator approach but exilicit non-async
+    # Don't use decorator approach but explicit non-async
     # function to fail fast and explicitly
     # if passed arguments don't match the function signature
     return _ContextManagerHelper(_connect(host, port, limit,
@@ -442,7 +442,7 @@
                      ssl_handshake_timeout=None):
         """Similar to `connect()` but works with UNIX Domain Sockets."""
         # Design note:
-        # Don't use decorator approach but exilicit non-async
+        # Don't use decorator approach but explicit non-async
         # function to fail fast and explicitly
         # if passed arguments don't match the function signature
         return _ContextManagerHelper(_connect_unix(path,
diff --git a/Lib/bdb.py b/Lib/bdb.py
index fd34976..7b19ba3 100644
--- a/Lib/bdb.py
+++ b/Lib/bdb.py
@@ -38,7 +38,7 @@
         """Return canonical form of filename.
 
         For real filenames, the canonical form is a case-normalized (on
-        case insenstive filesystems) absolute path.  'Filenames' with
+        case insensitive filesystems) absolute path.  'Filenames' with
         angle brackets, such as "<stdin>", generated in interactive
         mode, are returned unchanged.
         """
diff --git a/Lib/multiprocessing/util.py b/Lib/multiprocessing/util.py
index 1938091..32b51b0 100644
--- a/Lib/multiprocessing/util.py
+++ b/Lib/multiprocessing/util.py
@@ -238,7 +238,7 @@
         if self._kwargs:
             x += ', kwargs=' + str(self._kwargs)
         if self._key[0] is not None:
-            x += ', exitprority=' + str(self._key[0])
+            x += ', exitpriority=' + str(self._key[0])
         return x + '>'
 
 
diff --git a/Lib/test/lock_tests.py b/Lib/test/lock_tests.py
index 8885868..d12a86e 100644
--- a/Lib/test/lock_tests.py
+++ b/Lib/test/lock_tests.py
@@ -467,7 +467,7 @@
         # of the workers.
         # Secondly, this test assumes that condition variables are not subject
         # to spurious wakeups.  The absence of spurious wakeups is an implementation
-        # detail of Condition Cariables in current CPython, but in general, not
+        # detail of Condition Variables in current CPython, but in general, not
         # a guaranteed property of condition variables as a programming
         # construct.  In particular, it is possible that this can no longer
         # be conveniently guaranteed should their implementation ever change.
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py
index c8bf8af..6072307 100644
--- a/Lib/test/test_cmd_line_script.py
+++ b/Lib/test/test_cmd_line_script.py
@@ -474,7 +474,7 @@
             ('os.path', br'loader.*cannot handle'),
             ('importlib', br'No module named.*'
                 br'is a package and cannot be directly executed'),
-            ('importlib.nonexistant', br'No module named'),
+            ('importlib.nonexistent', br'No module named'),
             ('.unittest', br'Relative module names not supported'),
         )
         for name, regex in tests:
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 7f01de6..a2a66a7 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -1927,7 +1927,7 @@
                  'r', 'c', 'd', ' ', 's', 's', 'i', 'i', 'm', 'm', 'l'])
 
         # Math operations order first by the order encountered in the left
-        # operand and then by the order encounted in the right operand.
+        # operand and then by the order encountered in the right operand.
         ps = 'aaabbcdddeefggghhijjjkkl'
         qs = 'abbcccdeefffhkkllllmmnno'
         order = {letter: i for i, letter in enumerate(dict.fromkeys(ps + qs))}
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 770e0c4..4368bb5 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -3025,7 +3025,7 @@
         # Testing a str subclass used as dict key ..
 
         class cistr(str):
-            """Sublcass of str that computes __eq__ case-insensitively.
+            """Subclass of str that computes __eq__ case-insensitively.
 
             Also computes a hash code of the string in canonical form.
             """
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py
index 83804cb..4559cd5 100644
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -48,7 +48,7 @@
 
 def testcommon(formatstr, args, output=None, limit=None, overflowok=False):
     # if formatstr is a str, test str, bytes, and bytearray;
-    # otherwise, test bytes and bytearry
+    # otherwise, test bytes and bytearray
     if isinstance(formatstr, str):
         testformat(formatstr, args, output, limit, overflowok)
         b_format = formatstr.encode('ascii')
diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py
index 2dab530..311143d 100644
--- a/Lib/test/test_gc.py
+++ b/Lib/test/test_gc.py
@@ -912,7 +912,7 @@
     def test_collect_garbage(self):
         self.preclean()
         # Each of these cause four objects to be garbage: Two
-        # Uncolectables and their instance dicts.
+        # Uncollectables and their instance dicts.
         Uncollectable()
         Uncollectable()
         C1055820(666)
diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py
index 896bbe9..f2eb6d7 100644
--- a/Lib/test/test_hmac.py
+++ b/Lib/test/test_hmac.py
@@ -445,7 +445,7 @@
         a, b = bytearray(b"foobar"), bytearray(b"foobar")
         self.assertTrue(hmac.compare_digest(a, b))
 
-        # Testing bytearrays of diffeent lengths
+        # Testing bytearrays of different lengths
         a, b = bytearray(b"foobar"), bytearray(b"foo")
         self.assertFalse(hmac.compare_digest(a, b))
 
@@ -458,7 +458,7 @@
         self.assertTrue(hmac.compare_digest(a, b))
         self.assertTrue(hmac.compare_digest(b, a))
 
-        # Testing byte bytearray of diffeent lengths
+        # Testing byte bytearray of different lengths
         a, b = bytearray(b"foobar"), b"foo"
         self.assertFalse(hmac.compare_digest(a, b))
         self.assertFalse(hmac.compare_digest(b, a))
@@ -472,7 +472,7 @@
         a, b = "foobar", "foobar"
         self.assertTrue(hmac.compare_digest(a, b))
 
-        # Testing str of diffeent lengths
+        # Testing str of different lengths
         a, b = "foo", "foobar"
         self.assertFalse(hmac.compare_digest(a, b))
 
diff --git a/Lib/test/test_importlib/source/test_file_loader.py b/Lib/test/test_importlib/source/test_file_loader.py
index 3ffb2aa..ab44722 100644
--- a/Lib/test/test_importlib/source/test_file_loader.py
+++ b/Lib/test/test_importlib/source/test_file_loader.py
@@ -325,7 +325,7 @@
             )
 
     @util.writes_bytecode_files
-    def test_overiden_unchecked_hash_based_pyc(self):
+    def test_overridden_unchecked_hash_based_pyc(self):
         with util.create_modules('_temp') as mapping, \
              unittest.mock.patch('_imp.check_hash_based_pycs', 'always'):
             source = mapping['_temp']
diff --git a/Lib/test/test_importlib/test_main.py b/Lib/test/test_importlib/test_main.py
index bc42b83..3d7da81 100644
--- a/Lib/test/test_importlib/test_main.py
+++ b/Lib/test/test_importlib/test_main.py
@@ -32,7 +32,7 @@
 class ImportTests(fixtures.DistInfoPkg, unittest.TestCase):
     def test_import_nonexistent_module(self):
         # Ensure that the MetadataPathFinder does not crash an import of a
-        # non-existant module.
+        # non-existent module.
         with self.assertRaises(ImportError):
             importlib.import_module('does_not_exist')
 
diff --git a/Lib/test/test_importlib/util.py b/Lib/test/test_importlib/util.py
index 913db4b..5aaf277 100644
--- a/Lib/test/test_importlib/util.py
+++ b/Lib/test/test_importlib/util.py
@@ -443,7 +443,7 @@
                 yield entry
 
     name = 'testingpackage'
-    # Unforunately importlib.util.module_from_spec() was not introduced until
+    # Unfortunately importlib.util.module_from_spec() was not introduced until
     # Python 3.5.
     module = types.ModuleType(name)
     loader = Reader()
diff --git a/Lib/test/test_statistics.py b/Lib/test/test_statistics.py
index 23dd96e..01b317c 100644
--- a/Lib/test/test_statistics.py
+++ b/Lib/test/test_statistics.py
@@ -1810,13 +1810,13 @@
         # Test mode with bimodal data.
         data = [1, 1, 2, 2, 2, 2, 3, 4, 5, 6, 6, 6, 6, 7, 8, 9, 9]
         assert data.count(2) == data.count(6) == 4
-        # mode() should return 2, the first encounted mode
+        # mode() should return 2, the first encountered mode
         self.assertEqual(self.func(data), 2)
 
     def test_unique_data(self):
         # Test mode when data points are all unique.
         data = list(range(10))
-        # mode() should return 0, the first encounted mode
+        # mode() should return 0, the first encountered mode
         self.assertEqual(self.func(data), 0)
 
     def test_none_data(self):
diff --git a/Lib/test/test_tracemalloc.py b/Lib/test/test_tracemalloc.py
index c386648..4b9bf4e 100644
--- a/Lib/test/test_tracemalloc.py
+++ b/Lib/test/test_tracemalloc.py
@@ -885,7 +885,7 @@
             return
         if b'PYTHONTRACEMALLOC: invalid number of frames' in stderr:
             return
-        self.fail(f"unexpeced output: {stderr!a}")
+        self.fail(f"unexpected output: {stderr!a}")
 
 
     def test_env_var_invalid(self):
@@ -914,7 +914,7 @@
             return
         if b'-X tracemalloc=NFRAME: invalid number of frames' in stderr:
             return
-        self.fail(f"unexpeced output: {stderr!a}")
+        self.fail(f"unexpected output: {stderr!a}")
 
     def test_sys_xoptions_invalid(self):
         for nframe in INVALID_NFRAME:
diff --git a/Lib/test/test_warnings/__init__.py b/Lib/test/test_warnings/__init__.py
index be848b2..d103182 100644
--- a/Lib/test/test_warnings/__init__.py
+++ b/Lib/test/test_warnings/__init__.py
@@ -714,7 +714,7 @@
             self.assertRaises(TypeError, self.module.warn, "Warning!")
 
     def test_show_warning_output(self):
-        # With showarning() missing, make sure that output is okay.
+        # With showwarning() missing, make sure that output is okay.
         text = 'test show_warning'
         with original_warnings.catch_warnings(module=self.module):
             self.module.filterwarnings("always", category=UserWarning)
diff --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py
index dc2b46e..91a2bbc 100644
--- a/Lib/test/test_winreg.py
+++ b/Lib/test/test_winreg.py
@@ -229,7 +229,7 @@
         h.Close()
         self.assertEqual(h.handle, 0)
 
-    def test_inexistant_remote_registry(self):
+    def test_nonexistent_remote_registry(self):
         connect = lambda: ConnectRegistry("abcdefghijkl", HKEY_CURRENT_USER)
         self.assertRaises(OSError, connect)
 
diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py
index bce3329..6af4514 100644
--- a/Lib/test/test_wsgiref.py
+++ b/Lib/test/test_wsgiref.py
@@ -586,10 +586,10 @@
         expected.update({
             # X doesn't exist in os_environ
             "X": "Y",
-            # HOME is overriden by TestHandler
+            # HOME is overridden by TestHandler
             'HOME': "/override/home",
 
-            # overriden by setup_testing_defaults()
+            # overridden by setup_testing_defaults()
             "SCRIPT_NAME": "",
             "SERVER_NAME": "127.0.0.1",
 
diff --git a/Lib/tkinter/filedialog.py b/Lib/tkinter/filedialog.py
index dbb97dd..3ed93eb 100644
--- a/Lib/tkinter/filedialog.py
+++ b/Lib/tkinter/filedialog.py
@@ -469,7 +469,7 @@
     except (ImportError, AttributeError):
         pass
 
-    # dialog for openening files
+    # dialog for opening files
 
     openfilename=askopenfilename(filetypes=[("all files", "*")])
     try:
diff --git a/Lib/unittest/test/testmock/testpatch.py b/Lib/unittest/test/testmock/testpatch.py
index 27914a9..0632d95 100644
--- a/Lib/unittest/test/testmock/testpatch.py
+++ b/Lib/unittest/test/testmock/testpatch.py
@@ -1651,7 +1651,7 @@
             p1.stop()
         self.assertEqual(squizz.squozz, 3)
 
-    def test_patch_propogrates_exc_on_exit(self):
+    def test_patch_propagates_exc_on_exit(self):
         class holder:
             exc_info = None, None, None
 
@@ -1680,9 +1680,9 @@
 
         self.assertIs(holder.exc_info[0], RuntimeError)
         self.assertIsNotNone(holder.exc_info[1],
-                            'exception value not propgated')
+                            'exception value not propagated')
         self.assertIsNotNone(holder.exc_info[2],
-                            'exception traceback not propgated')
+                            'exception traceback not propagated')
 
 
     def test_create_and_specs(self):
diff --git a/Lib/uuid.py b/Lib/uuid.py
index 7aa01bb..188e16b 100644
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -680,7 +680,7 @@
     return random.getrandbits(48) | (1 << 40)
 
 
-# _OS_GETTERS, when known, are targetted for a specific OS or platform.
+# _OS_GETTERS, when known, are targeted for a specific OS or platform.
 # The order is by 'common practice' on the specified platform.
 # Note: 'posix' and 'windows' _OS_GETTERS are prefixed by a dll/dlload() method
 # which, when successful, means none of these "external" methods are called.