]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix typos in comments and docstring (#122720)
authorXie Yanbo <xieyanbo@gmail.com>
Wed, 7 Aug 2024 06:39:16 +0000 (14:39 +0800)
committerGitHub <noreply@github.com>
Wed, 7 Aug 2024 06:39:16 +0000 (07:39 +0100)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Lib/enum.py
Lib/mimetypes.py
Lib/pdb.py
Lib/shutil.py
Lib/test/datetimetester.py
Lib/test/test__interpreters.py
Lib/test/test_array.py
Lib/typing.py
Lib/uuid.py

index c36fc75a24a2392ecc492573ec3105fec968254a..c86d7ddb15dbba3922e80d62b4f9554239ffc63e 100644 (file)
@@ -207,7 +207,7 @@ class property(DynamicClassAttribute):
             # use previous enum.property
             return self.fget(instance)
         elif self._attr_type == 'attr':
-            # look up previous attibute
+            # look up previous attribute
             return getattr(self._cls_type, self.name)
         elif self._attr_type == 'desc':
             # use previous descriptor
index bacee8ba164b483dc10e58c816434c2e228fdbc4..d7c4e8444f8decf04280b0a36e38a3df2c28bdda 100644 (file)
@@ -151,7 +151,7 @@ class MimeTypes:
     def guess_file_type(self, path, *, strict=True):
         """Guess the type of a file based on its path.
 
-        Similar to guess_type(), but takes file path istead of URL.
+        Similar to guess_type(), but takes file path instead of URL.
         """
         path = os.fsdecode(path)
         path = os.path.splitdrive(path)[1]
@@ -325,7 +325,7 @@ def guess_type(url, strict=True):
 def guess_file_type(path, *, strict=True):
     """Guess the type of a file based on its path.
 
-    Similar to guess_type(), but takes file path istead of URL.
+    Similar to guess_type(), but takes file path instead of URL.
     """
     if _db is None:
         init()
index 7ff973149b167b5ff076785b25e8bac5d01a2f5a..228de489a9cef100010163b3df6f460d95fd5def 100644 (file)
@@ -614,7 +614,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
             # We should print the stack entry if and only if the user input
             # is expected, and we should print it right before the user input.
             # We achieve this by appending _pdbcmd_print_frame_status to the
-            # command queue. If cmdqueue is not exausted, the user input is
+            # command queue. If cmdqueue is not exhausted, the user input is
             # not expected and we will not print the stack entry.
             self.cmdqueue.append('_pdbcmd_print_frame_status')
             self._cmdloop()
index 0235f6bae32f1478cbe1430dfd47a9af95268d4c..72b2d834dc387e34d79806f599f388fc363ad151 100644 (file)
@@ -149,7 +149,7 @@ def _fastcopy_sendfile(fsrc, fdst):
         try:
             sent = os.sendfile(outfd, infd, offset, blocksize)
         except OSError as err:
-            # ...in oder to have a more informative exception.
+            # ...in order to have a more informative exception.
             err.filename = fsrc.name
             err.filename2 = fdst.name
 
index b756413d7bf375c7b333f17ef559b84adcb7a5ad..d6b7adc992653b479ffeacca2a9729e2e7b81706 100644 (file)
@@ -3367,8 +3367,8 @@ class TestDateTime(TestDate):
             '2009-04-19T12:',               # Ends with time separator
             '2009-04-19T12:30:',            # Ends with time separator
             '2009-04-19T12:30:45.',         # Ends with time separator
-            '2009-04-19T12:30:45.123456+',  # Ends with timzone separator
-            '2009-04-19T12:30:45.123456-',  # Ends with timzone separator
+            '2009-04-19T12:30:45.123456+',  # Ends with timezone separator
+            '2009-04-19T12:30:45.123456-',  # Ends with timezone separator
             '2009-04-19T12:30:45.123456-05:00a',    # Extra text
             '2009-04-19T12:30:45.123-05:00a',       # Extra text
             '2009-04-19T12:30:45-05:00a',           # Extra text
index beeb280894ea99c73ea07e35b3d671ad4f310eff..f493a92e0ddce81dc5c5f2b9572d56da689a4fec 100644 (file)
@@ -43,7 +43,7 @@ def _run_output(interp, request):
 def _wait_for_interp_to_run(interp, timeout=None):
     # bpo-37224: Running this test file in multiprocesses will fail randomly.
     # The failure reason is that the thread can't acquire the cpu to
-    # run subinterpreter eariler than the main thread in multiprocess.
+    # run subinterpreter earlier than the main thread in multiprocess.
     if timeout is None:
         timeout = support.SHORT_TIMEOUT
     for _ in support.sleeping_retry(timeout, error=False):
index 47cbe60bfca4e4e504e3abdb1e21388b45a7cb1c..f621f343eb062a94bc3cfe27388ef51d4ad9d5f4 100755 (executable)
@@ -1492,7 +1492,7 @@ class FPTest(NumberTest):
             if a.itemsize==1:
                 self.assertEqual(a, b)
             else:
-                # On alphas treating the byte swapped bit patters as
+                # On alphas treating the byte swapped bit patterns as
                 # floats/doubles results in floating-point exceptions
                 # => compare the 8bit string values instead
                 self.assertNotEqual(a.tobytes(), b.tobytes())
index 626053d8166160b6faa63f5a0471dd25bdbf269f..39a14ae6f83c286c1be9f1ccad4098fec05d86a1 100644 (file)
@@ -1054,7 +1054,7 @@ def evaluate_forward_ref(
     evaluating the forward reference. This parameter must be provided (though
     it may be an empty tuple) if *owner* is not given and the forward reference
     does not already have an owner set. *format* specifies the format of the
-    annotation and is a member of the annoations.Format enum.
+    annotation and is a member of the annotationlib.Format enum.
 
     """
     if type_params is _sentinel:
index c286eac38e1ef45676d450c48de039fa7327e4ea..4d4f06cfc9ebbe3cc0ae5d1e39e1289e353faa99 100644 (file)
@@ -374,7 +374,7 @@ def _get_command_stdout(command, *args):
         # for are actually localized, but in theory some system could do so.)
         env = dict(os.environ)
         env['LC_ALL'] = 'C'
-        # Empty strings will be quoted by popen so we should just ommit it
+        # Empty strings will be quoted by popen so we should just omit it
         if args != ('',):
             command = (executable, *args)
         else: