summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXie Yanbo <xieyanbo@gmail.com>2024-08-07 06:39:16 (GMT)
committerGitHub <noreply@github.com>2024-08-07 06:39:16 (GMT)
commitb6c80e21c78ea86fb12b331f69881a586ed487e0 (patch)
treef3ccb152fa27be8da9e6fb84217e5c657d541c18
parent98dba73010e807e613b9400e8c4b411302498728 (diff)
downloadcpython-b6c80e21c78ea86fb12b331f69881a586ed487e0.zip
cpython-b6c80e21c78ea86fb12b331f69881a586ed487e0.tar.gz
cpython-b6c80e21c78ea86fb12b331f69881a586ed487e0.tar.bz2
Fix typos in comments and docstring (#122720)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
-rw-r--r--Lib/enum.py2
-rw-r--r--Lib/mimetypes.py4
-rw-r--r--Lib/pdb.py2
-rw-r--r--Lib/shutil.py2
-rw-r--r--Lib/test/datetimetester.py4
-rw-r--r--Lib/test/test__interpreters.py2
-rwxr-xr-xLib/test/test_array.py2
-rw-r--r--Lib/typing.py2
-rw-r--r--Lib/uuid.py2
9 files changed, 11 insertions, 11 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index c36fc75..c86d7dd 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -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
diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py
index bacee8b..d7c4e84 100644
--- a/Lib/mimetypes.py
+++ b/Lib/mimetypes.py
@@ -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()
diff --git a/Lib/pdb.py b/Lib/pdb.py
index 7ff9731..228de48 100644
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -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()
diff --git a/Lib/shutil.py b/Lib/shutil.py
index 0235f6b..72b2d83 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -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
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index b756413..d6b7adc 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -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
diff --git a/Lib/test/test__interpreters.py b/Lib/test/test__interpreters.py
index beeb280..f493a92 100644
--- a/Lib/test/test__interpreters.py
+++ b/Lib/test/test__interpreters.py
@@ -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):
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 47cbe60..f621f34 100755
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -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())
diff --git a/Lib/typing.py b/Lib/typing.py
index 626053d..39a14ae 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -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:
diff --git a/Lib/uuid.py b/Lib/uuid.py
index c286eac..4d4f06c 100644
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -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: