]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix typos in the Lib directory (GH-28775)
authorChristian Clauss <cclauss@me.com>
Wed, 6 Oct 2021 23:13:48 +0000 (01:13 +0200)
committerGitHub <noreply@github.com>
Wed, 6 Oct 2021 23:13:48 +0000 (16:13 -0700)
Fix typos in the Lib directory as identified by codespell.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
64 files changed:
Lib/asyncio/events.py
Lib/asyncio/unix_events.py
Lib/ctypes/_aix.py
Lib/ctypes/test/test_structures.py
Lib/difflib.py
Lib/distutils/ccompiler.py
Lib/distutils/command/install.py
Lib/email/errors.py
Lib/html/parser.py
Lib/idlelib/ChangeLog
Lib/idlelib/idle_test/htest.py
Lib/idlelib/idle_test/mock_tk.py
Lib/idlelib/idle_test/test_multicall.py
Lib/idlelib/idle_test/test_pyparse.py
Lib/importlib/_adapters.py
Lib/lib2to3/fixes/fix_metaclass.py
Lib/lib2to3/fixes/fix_paren.py
Lib/linecache.py
Lib/pickle.py
Lib/platform.py
Lib/sqlite3/test/test_dbapi.py
Lib/sysconfig.py
Lib/test/datetimetester.py
Lib/test/decimaltestdata/abs.decTest
Lib/test/decimaltestdata/extra.decTest
Lib/test/libregrtest/refleak.py
Lib/test/pickletester.py
Lib/test/support/threading_helper.py
Lib/test/test__xxsubinterpreters.py
Lib/test/test_asyncio/test_streams.py
Lib/test/test_asyncio/test_subprocess.py
Lib/test/test_asyncio/test_tasks.py
Lib/test/test_capi.py
Lib/test/test_collections.py
Lib/test/test_dataclasses.py
Lib/test/test_descr.py
Lib/test/test_dict.py
Lib/test/test_dict_version.py
Lib/test/test_dtrace.py
Lib/test/test_email/test_message.py
Lib/test/test_embed.py
Lib/test/test_exceptions.py
Lib/test/test_future.py
Lib/test/test_lltrace.py
Lib/test/test_locale.py
Lib/test/test_long.py
Lib/test/test_pathlib.py
Lib/test/test_strftime.py
Lib/test/test_sys.py
Lib/test/test_tempfile.py
Lib/test/test_time.py
Lib/test/test_unparse.py
Lib/test/test_weakref.py
Lib/test/test_wsgiref.py
Lib/test/test_xml_etree.py
Lib/test/test_xmlrpc.py
Lib/threading.py
Lib/tkinter/__init__.py
Lib/tkinter/test/test_ttk/test_widgets.py
Lib/unittest/async_case.py
Lib/unittest/test/testmock/testsealable.py
Lib/venv/scripts/common/Activate.ps1
Lib/wsgiref/validate.py
Lib/zoneinfo/_zoneinfo.py

index b966ad26bf467b0641cfe91d904cbd83e781ac79..7abaaca2d2b284fc9a0c682ea942b90ec689f418 100644 (file)
@@ -479,7 +479,7 @@ class AbstractEventLoop:
         # 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):
@@ -492,7 +492,7 @@ class AbstractEventLoop:
         # 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, *,
index e4f445e95026b55e7060a496d4da9841f1bc0e12..4cef914b9fb9eeb798fb53ef03221adeaee0506f 100644 (file)
@@ -1379,7 +1379,7 @@ class ThreadedChildWatcher(AbstractChildWatcher):
     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):
index 26959d90a4dd6a05424ea5c5af4c935b8f3291fb..fc3e95cbcc88a530f08da216145675df65ff8864 100644 (file)
@@ -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)
index 245cd94c5cdd9e9658dc5e216f83b6b7c44ab654..97ad2b8ed8a50d7580c3bdf560c6dc5527fb1121 100644 (file)
@@ -443,7 +443,7 @@ class StructureTestCase(unittest.TestCase):
 
         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 @@ class StructureTestCase(unittest.TestCase):
         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)
index 480bad2224c8e1e271c7d820a1da0e22d641fd64..afd8a0c7c5b61eb7b8bdf3931f47ce2c3d54eacd 100644 (file)
@@ -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>.
index b5ef143e72c56481128b8d7f91784096336e2bff..4c47f2ed245d4f569732a82c6e01badcf28af56b 100644 (file)
@@ -392,7 +392,7 @@ class CCompiler:
         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.
index 26696cfb9dcf9c6d80dbc7cbb0b9c2b70a47b13d..01d5331a63069b14241c6edad5682bc14f77ca48 100644 (file)
@@ -31,7 +31,7 @@ SCHEME_KEYS = ('purelib', 'platlib', 'headers', 'scripts', 'data')
 # while making the sysconfig module the single point of truth.
 # This makes it easier for OS distributions where they need to
 # alter locations for packages installations in a single place.
-# Note that this module is depracated (PEP 632); all consumers
+# Note that this module is deprecated (PEP 632); all consumers
 # of this information should switch to using sysconfig directly.
 INSTALL_SCHEMES = {"unix_prefix": {}, "unix_home": {}, "nt": {}}
 
@@ -43,7 +43,7 @@ for key in SCHEME_KEYS:
         sys_key = key
         sys_scheme = sysconfig._INSTALL_SCHEMES[sys_scheme_name]
         if key == "headers" and key not in sys_scheme:
-            # On POSIX-y platofrms, Python will:
+            # On POSIX-y platforms, Python will:
             # - Build from .h files in 'headers' (only there when
             #   building CPython)
             # - Install .h files to 'include'
index 1d258c34fc9d4a4d639facd6e0120bf251deec50..3ad00565549968629376276f2a304dbce070076a 100644 (file)
@@ -110,4 +110,4 @@ class NonASCIILocalPartDefect(HeaderDefect):
     # parsing messages decoded from binary.
 
 class InvalidDateDefect(HeaderDefect):
-    """Header has unparseable or invalid date"""
+    """Header has unparsable or invalid date"""
index 9e49effca1fcc5ae7378253883073b5d804675a5..58f6bb3b1e932dbfa0081662eae1c54bb7ec918b 100644 (file)
@@ -405,7 +405,7 @@ class HTMLParser(_markupbase.ParserBase):
             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)
index d7d7e1efdb1d308e22d07e7dca3cab502b204d1d..c8960cfa535d03464b2471e62b6712fafe76f10c 100644 (file)
@@ -1175,7 +1175,7 @@ Wed Mar 10 05:18:02 1999  Guido van Rossum  <guido@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).
index 1373b7642a6ea91039f8f8ffd2e1a600e1a92932..666ff4cb8485106640afd38014df66ab957b5322 100644 (file)
@@ -246,7 +246,7 @@ _multistatus_bar_spec = {
 _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 @@ _path_browser_spec = {
     '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 @@ _tree_widget_spec = {
     '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 = {
index db583553838fb3344c7a09f43500eea6736f6a36..8304734b847a835e5ad17227a66a0ff3b21eeaf7 100644 (file)
@@ -79,7 +79,7 @@ class Test(unittest.TestCase):
     ---
     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'
index ba582bb3ca51b4c99c2365317374649943773323..b3a3bfb88f9c31fa025d112803991212261e2508 100644 (file)
@@ -37,7 +37,7 @@ class MultiCallTest(unittest.TestCase):
 
     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)
index fb5726db1d821ebd4a94db7a83682f250d28b453..384db566ac76cdb44fb3c2998a989e848d56cd6c 100644 (file)
@@ -284,7 +284,7 @@ class PyParseTest(unittest.TestCase):
         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),
index 9907b148b396d266282aff7eea22a8fb6e52bd2d..ea363d86a564b5450666aa00aecd46353326a75a 100644 (file)
@@ -41,8 +41,8 @@ def _io_wrapper(file, mode='r', *args, **kwargs):
 
 class CompatibilityFiles:
     """
-    Adapter for an existing or non-existant resource reader
-    to provide a compability .files().
+    Adapter for an existing or non-existent resource reader
+    to provide a compatibility .files().
     """
 
     class SpecPath(abc.Traversable):
@@ -83,7 +83,7 @@ class CompatibilityFiles:
     class ChildPath(abc.Traversable):
         """
         Path tied to a resource reader child.
-        Can be read but doesn't expose any meaningfull children.
+        Can be read but doesn't expose any meaningful children.
         """
 
         def __init__(self, reader, name):
index d1cd10d327587cecef88ec2ca4c9c75243167072..fe547b2228072a3cf436733f40154004e98c215c 100644 (file)
@@ -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
index b205aa7e1e93fbe15d13bb259729f2b45fe0b322..df3da5f5232c9c42fc53c904f8c0b886b4dd4a51 100644 (file)
@@ -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)]``."""
 
index 513b17e999880b5cb0f018e21ec7ce90fd73caed..23191d6501d2a836b24edb452fc3ddb6c1a2b2bf 100644 (file)
@@ -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:
index 5ab312f2acaee6c2cfb32595c9a779fb5a98262c..e7f30f226101f52f518b2ced0f36010a6242711c 100644 (file)
@@ -1173,7 +1173,7 @@ class _Unpickler:
         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
index 240f701754d4acc08c0d9f7d2d2c7d3a891c1ea5..9e9b42238fb76c44b38e38d8eed28c62b8969181 100755 (executable)
@@ -1261,7 +1261,7 @@ _os_release_cache = None
 
 def _parse_os_release(lines):
     # These fields are mandatory fields with well-known defaults
-    # in pratice all Linux distributions override NAME, ID, and PRETTY_NAME.
+    # in practice all Linux distributions override NAME, ID, and PRETTY_NAME.
     info = {
         "NAME": "Linux",
         "ID": "linux",
index 732e21dd3a285ee1ca1530e7beef6573883c2a7a..c21688d2a774c9628ef2e42398cd0b73f4f0ea5a 100644 (file)
@@ -616,7 +616,7 @@ class CursorTests(unittest.TestCase):
         self.assertEqual(row, None)
 
     def test_array_size(self):
-        # must default ot 1
+        # must default to 1
         self.assertEqual(self.cu.arraysize, 1)
 
         # now set to 2
index 95b48f6429d5f81ad19a1cf6102d85e976117b0e..daf9f000060a35643a7f633cbbe7842a3260bc94 100644 (file)
@@ -184,7 +184,7 @@ _PYTHON_BUILD = is_python_build(True)
 
 if _PYTHON_BUILD:
     for scheme in ('posix_prefix', 'posix_home'):
-        # On POSIX-y platofrms, Python will:
+        # On POSIX-y platforms, Python will:
         # - Build from .h files in 'headers' (which is only added to the
         #   scheme when building CPython)
         # - Install .h files to 'include'
index 6414f1ace3fed31807c6ae62d2dee110477bd7f7..9f551d9b9748d395dc006958370241e5f6378020 100644 (file)
@@ -4064,7 +4064,7 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
         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 @@ class TestTimezoneConversions(unittest.TestCase):
         # 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
index 01f73d7766648f3d846c83d1a1b7452a220d37a8..569b8fcd84ab628f2c63c603f2384c653a3b3ce4 100644 (file)
@@ -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
index b630d8e3f9d45edb91ef56bf576a1a4f037ceda5..31291202a35e79ddd388979761ae3eda952bf0d0 100644 (file)
@@ -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
index 096b5381cd9339bca75d404f4f7a2042b90c7b26..b776a2cce647d04e15b0e4f292bbeffea983444f 100644 (file)
@@ -114,7 +114,7 @@ def dash_R(ns, test_name, test_func):
 
     # 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:
         #
index 25283f8c538d8ffb155c46c47aa3521bceabb018..3e2c781caa11acbf25dc436b1e6a044d2b8f9536 100644 (file)
@@ -3723,7 +3723,7 @@ class AbstractHookTests:
 
                 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
@@ -3740,7 +3740,7 @@ class AbstractHookTests:
     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):
index 0632577cdb303c0e4ad735c93ac6a223be3a3ae8..92a64e8354acbce5aa0762a2b84c6552103c7269 100644 (file)
@@ -157,7 +157,7 @@ class catch_threading_exception:
     Context manager catching threading.Thread exception using
     threading.excepthook.
 
-    Attributes set when an exception is catched:
+    Attributes set when an exception is caught:
 
     * exc_type
     * exc_value
index 81bce2e620421612a03bff2f795c00d61a46d612..177a8a64a4329fe193d36f1aa34fa7c6049ac5ae 100644 (file)
@@ -1221,7 +1221,7 @@ class ChannelTests(TestBase):
             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])
index 6eaa28994421843e020eef0f0de310f2bf60c3bd..a6ea24ceceda2a74760d2b5cb6fa27a6d7e347b8 100644 (file)
@@ -711,7 +711,7 @@ class StreamTests(test_utils.TestCase):
         # 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 = """\
index 3cf88188ecf3b17d2a54eef24eb9881280283a5d..14fa6dd76f9ca867d7ae2149d8da81923215f4e3 100644 (file)
@@ -228,7 +228,7 @@ class SubprocessMixin:
         # 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',
index 92b1a43500311d1ad9f54d6189f08cbb279746f7..362fbf8df08ca1018ddd291f46a81d376bf0a19a 100644 (file)
@@ -3269,7 +3269,7 @@ class RunCoroutineThreadsafeTests(test_utils.TestCase):
             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)
@@ -3277,7 +3277,7 @@ class RunCoroutineThreadsafeTests(test_utils.TestCase):
             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):
index bdb8f768fc3138e04a2aa1210ffcfa1d4565f2ba..d954942286676466701f3c064d4e913e7108fe9c 100644 (file)
@@ -264,7 +264,7 @@ class CAPITest(unittest.TestCase):
 
     def test_getitem_with_error(self):
         # Test _Py_CheckSlotResult(). Raise an exception and then calls
-        # PyObject_GetItem(): check that the assertion catchs the bug.
+        # PyObject_GetItem(): check that the assertion catches the bug.
         # PyObject_GetItem() must not be called with an exception set.
         code = textwrap.dedent("""
             import _testcapi
index b9be4c03142b6d39cfcaba73c19babf7c9ef2b13..1bfd44f954788165409b2c0d427a20733c7af461 100644 (file)
@@ -1594,7 +1594,7 @@ class TestCollectionABCs(ABCTestCase):
         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:
index 33c9fcd1656219d963dceae24ae1dd44c75da517..a1d9112135af3b863a539dba2dbe6b989d0a9eb3 100644 (file)
@@ -3695,7 +3695,7 @@ class TestKeywordArgs(unittest.TestCase):
         with self.assertRaisesRegex(TypeError, msg):
             B(3, 4, 5)
 
-        # Explicitely make a field that follows KW_ONLY be non-keyword-only.
+        # Explicitly make a field that follows KW_ONLY be non-keyword-only.
         @dataclass
         class C:
             a: int
index 9b919e7824445e4cfb72b6d6f25e488d1b4e7532..af7848c0b1b3c2d56c68fd09efa8b2201896fe2b 100644 (file)
@@ -5723,7 +5723,7 @@ class MroTest(unittest.TestCase):
 
     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):
index a6ce6f98c82907d5227fc04a8b386c4c936dfee9..40143757fd36a7e5b1f9e36573afa9b34d17c453 100644 (file)
@@ -1046,7 +1046,7 @@ class DictTest(unittest.TestCase):
 
     @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
@@ -1363,7 +1363,7 @@ class DictTest(unittest.TestCase):
         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({})), [])
index 8cdccad0d79ab620f474ea30c572c07e08b61825..243084c75c42bced1a5312f4a338c78452456d5e 100644 (file)
@@ -1,5 +1,5 @@
 """
-Test implementation of the PEP 509: dictionary versionning.
+Test implementation of the PEP 509: dictionary versioning.
 """
 import unittest
 from test.support import import_helper
index 1db73cc2d2220735c18960a3a4fe749b387f705a..3957077f5d612349070fa5440976d7282107828c 100644 (file)
@@ -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)
         )
 
 
index 920a3d6a9cb91be87612fe39f615ae60e840c99a..4c754bf40fc300826bf2fbbdd206c3b94f8e8477 100644 (file)
@@ -433,7 +433,7 @@ class TestEmailMessageBase:
                 --===
                 Content-Type: text/plain
 
-                Your message has bounced, ser.
+                Your message has bounced, sir.
 
                 --===
                 Content-Type: message/rfc822
index aa2b3d7efbf996aa218b45486fe46b4aa0d1a9d1..c748000f7005d1f32fee8b2793585a03e28cf44f 100644 (file)
@@ -250,7 +250,7 @@ class EmbeddingTests(EmbeddingTestsMixin, unittest.TestCase):
 
     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))
@@ -1170,7 +1170,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
              # The current getpath.c doesn't determine the stdlib dir
              # in this case.
             'stdlib_dir': '',
-            # overriden by PyConfig
+            # overridden by PyConfig
             'program_name': 'conf_program_name',
             'base_executable': 'conf_executable',
             'executable': 'conf_executable',
index 70d10ebc66e98bdcc25334b7d2cec480162cb8a4..289288478c285ae16d1ce81f0d35a47fa8ef522e 100644 (file)
@@ -2281,7 +2281,7 @@ class SyntaxErrorTests(unittest.TestCase):
                  abcdefg
              SyntaxError: bad bad
              """)),
-            # End offset pass the source lenght
+            # End offset pass the source length
             (("bad.py", 1, 2, "abcdefg", 1, 100),
              dedent(
              """
index 4ef11232a336819dbea468218d751be21a5c0b91..5a3944e69e640ef3a6f68049a6a0775806faeb47 100644 (file)
@@ -329,7 +329,7 @@ class AnnotationsFutureTestCase(unittest.TestCase):
 
     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}'")
index 8f1a92e5c725c3061f01bc61b26bccb9344f7ac1..06e33f4c4c2f3859cddc810c24432ff125f8ba53 100644 (file)
@@ -12,7 +12,7 @@ class TestLLTrace(unittest.TestCase):
         # 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(os_helper.TESTFN, 'w', encoding='utf-8') as fd:
             self.addCleanup(os_helper.unlink, os_helper.TESTFN)
             fd.write(textwrap.dedent("""\
index 2c788f2dfa65e6ad4cb3ad8c47d1eb21dce53ae1..f844e62ca2e72be8245fcc779fa9e2d18db8fd6a 100644 (file)
@@ -496,7 +496,7 @@ class NormalizeTest(unittest.TestCase):
 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
index e15bf8b418676a5aab89a715ba9c14038e0c03ff..e5c4d7fc4220f8a60d8099f156dca8e05cb6a7ee 100644 (file)
@@ -1260,7 +1260,7 @@ class LongTest(unittest.TestCase):
                             expected)
                     except Exception as err:
                         raise AssertionError(
-                            "failed to convert {} with default arugments"
+                            "failed to convert {} with default arguments"
                             .format(test)) from err
 
                 try:
index e716f4d3859326389f27911dd9e26d7d98dca5b6..5f6d9f47d13d7545d265d9a68424265e760a3470 100644 (file)
@@ -324,7 +324,7 @@ class _BasePurePathTest(object):
         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'))
@@ -1284,7 +1284,7 @@ class PureWindowsPathTest(_BasePurePathTest, unittest.TestCase):
         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())
index ec305e54ff24f0c88d0f405855f27370406e28c7..be43c49e40aa50f2f22813da64b86a677bb8e6e8 100644 (file)
@@ -114,7 +114,7 @@ class StrftimeTest(unittest.TestCase):
         )
 
         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:
index 3b80904b28d3e223192da2ecc9752874df3c7d71..cf708407c290342888ceec05ef7fae0a5bebb750 100644 (file)
@@ -381,7 +381,7 @@ class SysModuleTest(unittest.TestCase):
         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)
@@ -448,7 +448,7 @@ class SysModuleTest(unittest.TestCase):
         self.assertEqual((None, None, None), d.pop(main_id))
 
         # 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.
         exc_type, exc_value, exc_tb = d.pop(thread_id)
         stack = traceback.extract_stack(exc_tb.tb_frame)
index f1d483733e26755f1597ff477739e7779f9cd519..96946a281a490b75f7fb714321ae2b4031eaf37d 100644 (file)
@@ -1435,7 +1435,7 @@ class TestTemporaryDirectory(BaseTestCase):
             self.assertEqual(
                 temp_path.exists(),
                 sys.platform.startswith("win"),
-                f"TemporaryDirectory {temp_path!s} existance state unexpected")
+                f"TemporaryDirectory {temp_path!s} existence state unexpected")
             temp_dir.cleanup()
             self.assertFalse(
                 temp_path.exists(),
@@ -1494,7 +1494,7 @@ class TestTemporaryDirectory(BaseTestCase):
             self.assertEqual(
                 temp_path.exists(),
                 sys.platform.startswith("win"),
-                f"TemporaryDirectory {temp_path!s} existance state unexpected")
+                f"TemporaryDirectory {temp_path!s} existence state unexpected")
 
     def test_del_on_shutdown(self):
         # A TemporaryDirectory may be cleaned up during shutdown
@@ -1559,7 +1559,7 @@ class TestTemporaryDirectory(BaseTestCase):
             self.assertEqual(
                 temp_path.exists(),
                 sys.platform.startswith("win"),
-                f"TemporaryDirectory {temp_path!s} existance state unexpected")
+                f"TemporaryDirectory {temp_path!s} existence state unexpected")
             err = err.decode('utf-8', 'backslashreplace')
             self.assertNotIn("Exception", err)
             self.assertNotIn("Error", err)
index f7fd6510d8aa7a6879e882b0d076f52ae4870293..f98aec2651d9d77fac5eb937660081918e06fc3e 100644 (file)
@@ -440,8 +440,8 @@ class TimeTestCase(unittest.TestCase):
     @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)
index 63151ec89d8551b7e273f44c2ff9c96dd32287cf..d8ba487328b3932ddf2b7cdfd56e4e3ef88d1227 100644 (file)
@@ -427,7 +427,7 @@ class UnparseTestCase(ASTTestCase):
 
 
 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)")
index 3bdc86d6923e02ed4689e68f7f69b619abf0d8fe..46dac0228295d74a821d847aae7001e09831494d 100644 (file)
@@ -1473,7 +1473,7 @@ class MappingTestCase(TestBase):
         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
index cf40e5a5c85d2e9dce015ad0fa9f63708599a071..9316d0ecbcf1aef2aa851a5bd2d1e3e3925ea848 100644 (file)
@@ -556,7 +556,7 @@ class HandlerTests(TestCase):
         # 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:
index 5a8824a78ffa4b64f9386b9a124ac5841ba0e37b..285559a872a65fbcac886f4aa0f1c3b4bf871ee2 100644 (file)
@@ -3331,7 +3331,7 @@ class TreeBuilderTest(unittest.TestCase):
         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
index 85e27ad4631d2971e58e8422494e986a7b4d903d..1f06f5fdf483e9d2722cb0e523eb23076a4b33c0 100644 (file)
@@ -561,7 +561,7 @@ class DateTimeTestCase(unittest.TestCase):
 
 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?
index 2f473bf1b2c2b3df3d625abeaf5954d43c750282..6068d06ab6c906e1e727d32e2641318ef14794d2 100644 (file)
@@ -1572,7 +1572,7 @@ def _shutdown():
             break
 
         for lock in locks:
-            # mimick Thread.join()
+            # mimic Thread.join()
             lock.acquire()
             lock.release()
 
index 2513c972bc77f0701f45bd9514575768368e764b..2e7e21c6648ea80d84e87fa662f018e0a3a863da 100644 (file)
@@ -2735,7 +2735,7 @@ class Canvas(Widget, XView, YView):
         """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):
@@ -3330,7 +3330,7 @@ class Menu(Widget):
         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):
@@ -3355,7 +3355,7 @@ class Menu(Widget):
         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):
index ee5af82fd1b4482fa17c95d80bc9ad2e08235d7d..082da5d0c1a0045f57bcd57b0db1cd627259bdf8 100644 (file)
@@ -968,7 +968,7 @@ class NotebookTest(AbstractWidgetTest, unittest.TestCase):
         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)
index 3e864d14d112fa93fa9aa7d57c8137d1e0d06912..d8bfaf6b67e004fa48af6d30b6d4d94bc20bba89 100644 (file)
@@ -53,7 +53,7 @@ class IsolatedAsyncioTestCase(TestCase):
         # 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)
index 11784c3678918ff43f1b5e23bd988d1d287b3dd3..daba2b49b46f6351d3032582935beea3ab615939 100644 (file)
@@ -128,7 +128,7 @@ class TestSealable(unittest.TestCase):
             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
index 51fc55c4ec7cb9cacf8d75734b91e3deb187707f..eeea3583fa130d4702a05012a2103152daf51487 100644 (file)
@@ -202,7 +202,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
     }
index 48ac0070549b3fa25090b087f7050c9661b1c2cf..6e16578dbb648f57f729579f00fd06a4ad14b66f 100644 (file)
@@ -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
index 9810637d3ef65eecb617c8fc86526d8dcb9a5094..de68380792f17c329b02d9ace3a3d6739d5e9c2e 100644 (file)
@@ -338,7 +338,7 @@ class ZoneInfo(tzinfo):
                 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