[3.10] Fix typos in the Lib directory (GH-28775) (GH-28804)

Fix typos in the Lib directory as identified by codespell.

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

Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
Christian Clauss 2021-10-07 17:49:47 +02:00 committed by GitHub
parent 03bf55d8cf
commit cfca4a6774
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
62 changed files with 79 additions and 79 deletions

View File

@ -479,7 +479,7 @@ async def connect_read_pipe(self, protocol_factory, pipe):
# The reason to accept file-like object instead of just file descriptor # The reason to accept file-like object instead of just file descriptor
# is: we need to own pipe and close it at transport finishing # is: we need to own pipe and close it at transport finishing
# Can got complicated errors if pass f.fileno(), # 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 raise NotImplementedError
async def connect_write_pipe(self, protocol_factory, pipe): async def connect_write_pipe(self, protocol_factory, pipe):
@ -492,7 +492,7 @@ async def connect_write_pipe(self, protocol_factory, pipe):
# The reason to accept file-like object instead of just file descriptor # The reason to accept file-like object instead of just file descriptor
# is: we need to own pipe and close it at transport finishing # is: we need to own pipe and close it at transport finishing
# Can got complicated errors if pass f.fileno(), # 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 raise NotImplementedError
async def subprocess_shell(self, protocol_factory, cmd, *, async def subprocess_shell(self, protocol_factory, cmd, *,

View File

@ -1379,7 +1379,7 @@ def add_child_handler(self, pid, callback, *args):
def remove_child_handler(self, pid): def remove_child_handler(self, pid):
# asyncio never calls remove_child_handler() !!! # asyncio never calls remove_child_handler() !!!
# The method is no-op but is implemented because # The method is no-op but is implemented because
# abstract base classe requires it # abstract base classes requires it
return True return True
def attach_loop(self, loop): def attach_loop(self, loop):

View File

@ -163,7 +163,7 @@ def get_legacy(members):
return member return member
else: else:
# 32-bit legacy names - both shr.o and shr4.o exist. # 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 # i.e., shr4.o is returned only when shr.o does not exist
for name in ['shr.o', 'shr4.o']: for name in ['shr.o', 'shr4.o']:
member = get_one_match(re.escape(name), members) member = get_one_match(re.escape(name), members)

View File

@ -443,7 +443,7 @@ def __del__(self):
s = Test(1, 2, 3) s = Test(1, 2, 3)
# Test the StructUnionType_paramfunc() code path which copies the # 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)) self.assertGreater(sizeof(s), sizeof(c_void_p))
dll = CDLL(_ctypes_test.__file__) dll = CDLL(_ctypes_test.__file__)
@ -451,7 +451,7 @@ def __del__(self):
func.argtypes = (Test,) func.argtypes = (Test,)
func.restype = None func.restype = None
func(s) func(s)
# bpo-37140: Passing the structure by refrence must not call # bpo-37140: Passing the structure by reference must not call
# its finalizer! # its finalizer!
self.assertEqual(finalizer_calls, []) self.assertEqual(finalizer_calls, [])
self.assertEqual(s.first, 1) self.assertEqual(s.first, 1)

View File

@ -62,7 +62,7 @@ class SequenceMatcher:
notion, pairing up elements that appear uniquely in each sequence. notion, pairing up elements that appear uniquely in each sequence.
That, and the method here, appear to yield more intuitive difference That, and the method here, appear to yield more intuitive difference
reports than does diff. This method appears to be the least vulnerable 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 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 because this is the only method of the 3 that has a *concept* of
"junk" <wink>. "junk" <wink>.

View File

@ -392,7 +392,7 @@ def _fix_compile_args(self, output_dir, macros, include_dirs):
return output_dir, macros, include_dirs return output_dir, macros, include_dirs
def _prep_compile(self, sources, output_dir, depends=None): 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', Determine the list of object files corresponding to 'sources',
and figure out which ones really need to be recompiled. and figure out which ones really need to be recompiled.

View File

@ -31,7 +31,7 @@
# while making the sysconfig module the single point of truth. # while making the sysconfig module the single point of truth.
# This makes it easier for OS distributions where they need to # This makes it easier for OS distributions where they need to
# alter locations for packages installations in a single place. # 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. # of this information should switch to using sysconfig directly.
INSTALL_SCHEMES = {"unix_prefix": {}, "unix_home": {}, "nt": {}} INSTALL_SCHEMES = {"unix_prefix": {}, "unix_home": {}, "nt": {}}
@ -43,7 +43,7 @@
sys_key = key sys_key = key
sys_scheme = sysconfig._INSTALL_SCHEMES[sys_scheme_name] sys_scheme = sysconfig._INSTALL_SCHEMES[sys_scheme_name]
if key == "headers" and key not in sys_scheme: 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 # - Build from .h files in 'headers' (only there when
# building CPython) # building CPython)
# - Install .h files to 'include' # - Install .h files to 'include'

View File

@ -110,4 +110,4 @@ class NonASCIILocalPartDefect(HeaderDefect):
# parsing messages decoded from binary. # parsing messages decoded from binary.
class InvalidDateDefect(HeaderDefect): class InvalidDateDefect(HeaderDefect):
"""Header has unparseable or invalid date""" """Header has unparsable or invalid date"""

View File

@ -405,7 +405,7 @@ def parse_endtag(self, i):
tagname = namematch.group(1).lower() tagname = namematch.group(1).lower()
# consume and ignore other stuff between the name and the > # consume and ignore other stuff between the name and the >
# Note: this is not 100% correct, since we might have things like # 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 # most of the cases and is much simpler
gtpos = rawdata.find('>', namematch.end()) gtpos = rawdata.find('>', namematch.end())
self.handle_endtag(tagname) self.handle_endtag(tagname)

View File

@ -1175,7 +1175,7 @@ Wed Mar 10 05:18:02 1999 Guido van Rossum <guido@cnri.reston.va.us>
classes in selected module classes in selected module
methods of selected class 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 column with info about the selected item. Double clicking in a
module, class or method item opens the file (and selects the clicked module, class or method item opens the file (and selects the clicked
item if it is a class or method). item if it is a class or method).

View File

@ -79,7 +79,7 @@ def tearDownClass(cls):
--- ---
For 'ask' functions, set func.result return value before calling the method For 'ask' functions, set func.result return value before calling the method
that uses the message function. When messagebox functions are the 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 askokcancel = Mbox_func() # True or False
askquestion = Mbox_func() # 'yes' or 'no' askquestion = Mbox_func() # 'yes' or 'no'

View File

@ -37,7 +37,7 @@ def test_init(self):
def test_yview(self): def test_yview(self):
# Added for tree.wheel_event # Added for tree.wheel_event
# (it depends on yview to not be overriden) # (it depends on yview to not be overridden)
mc = self.mc mc = self.mc
self.assertIs(mc.yview, Text.yview) self.assertIs(mc.yview, Text.yview)
mctext = self.mc(self.root) mctext = self.mc(self.root)

View File

@ -284,7 +284,7 @@ def test_get_num_lines_in_stmt(self):
tests = ( tests = (
TestInfo('[x for x in a]\n', 1), # Closed on one line. 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), # 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('[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),
TestInfo('\n"""Docstring comment L1\nL2"""\nL3\nL4\n', 1), TestInfo('\n"""Docstring comment L1\nL2"""\nL3\nL4\n', 1),

View File

@ -51,7 +51,7 @@ def fixup_parse_tree(cls_node):
# already in the preferred format, do nothing # already in the preferred format, do nothing
return 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): for i, node in enumerate(cls_node.children):
if node.type == token.COLON: if node.type == token.COLON:
break break

View 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)]``.""" This converts ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``."""

View File

@ -154,7 +154,7 @@ def lazycache(filename, module_globals):
:return: True if a lazy load is registered in the cache, :return: True if a lazy load is registered in the cache,
otherwise False. To register such a load a module loader with a 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. filename, and the filename must not be already cached.
""" """
if filename in cache: if filename in cache:

View File

@ -1173,7 +1173,7 @@ def __init__(self, file, *, fix_imports=True,
used in Python 3. The *encoding* and *errors* tell pickle how used in Python 3. The *encoding* and *errors* tell pickle how
to decode 8-bit string instances pickled by Python 2; these to decode 8-bit string instances pickled by Python 2; these
default to 'ASCII' and 'strict', respectively. *encoding* can be 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._buffers = iter(buffers) if buffers is not None else None
self._file_readline = file.readline self._file_readline = file.readline

View File

@ -1262,7 +1262,7 @@ def platform(aliased=0, terse=0):
def _parse_os_release(lines): def _parse_os_release(lines):
# These fields are mandatory fields with well-known defaults # 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 = { info = {
"NAME": "Linux", "NAME": "Linux",
"ID": "linux", "ID": "linux",

View File

@ -454,7 +454,7 @@ def test_fetchone_no_statement(self):
self.assertEqual(row, None) self.assertEqual(row, None)
def test_array_size(self): def test_array_size(self):
# must default ot 1 # must default to 1
self.assertEqual(self.cu.arraysize, 1) self.assertEqual(self.cu.arraysize, 1)
# now set to 2 # now set to 2

View File

@ -184,7 +184,7 @@ def is_python_build(check_home=False):
if _PYTHON_BUILD: if _PYTHON_BUILD:
for scheme in ('posix_prefix', 'posix_home'): 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 # - Build from .h files in 'headers' (which is only added to the
# scheme when building CPython) # scheme when building CPython)
# - Install .h files to 'include' # - Install .h files to 'include'

View File

@ -4064,7 +4064,7 @@ def test_even_more_compare(self):
self.assertEqual(t1, t1) self.assertEqual(t1, t1)
self.assertEqual(t2, t2) self.assertEqual(t2, t2)
# Equal afer adjustment. # Equal after adjustment.
t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, "")) 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, "")) t2 = self.theclass(2, 1, 1, 3, 13, tzinfo=FixedOffset(3*60+13+2, ""))
self.assertEqual(t1, t2) self.assertEqual(t1, t2)
@ -4903,7 +4903,7 @@ def test_easy(self):
# OTOH, these fail! Don't enable them. The difficulty is that # OTOH, these fail! Don't enable them. The difficulty is that
# the edge case tests assume that every hour is representable in # the edge case tests assume that every hour is representable in
# the "utc" class. This is always true for a fixed-offset tzinfo # 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 # For these adjacent DST-aware time zones, the range of time offsets
# tested ends up creating hours in the one that aren't representable # 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 # in the other. For the same reason, we would see failures in the

View File

@ -20,7 +20,7 @@
version: 2.59 version: 2.59
-- This set of tests primarily tests the existence of the operator. -- 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. -- elsewhere.
precision: 9 precision: 9

View 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 -- 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 -- incorrect answers when the finite number required rounding; similarly
-- for the other thre functions -- for the other three functions
maxexponent: 999 maxexponent: 999
minexponent: -999 minexponent: -999
precision: 6 precision: 6

View File

@ -112,7 +112,7 @@ def get_pooled_int(value):
# These checkers return False on success, True on failure # These checkers return False on success, True on failure
def check_rc_deltas(deltas): 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: # bpo-30776: Try to ignore false positives:
# #

View File

@ -3723,7 +3723,7 @@ class MyClass:
self.assertEqual(new_f, 5) self.assertEqual(new_f, 5)
self.assertEqual(some_str, 'some str') 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 # custom reduction callback should silently direct the pickler
# to the default pickling by attribute, by returning # to the default pickling by attribute, by returning
# NotImplemented # NotImplemented
@ -3740,7 +3740,7 @@ class MyClass:
def test_reducer_override_no_reference_cycle(self): def test_reducer_override_no_reference_cycle(self):
# bpo-39492: reducer_override used to induce a spurious reference cycle # bpo-39492: reducer_override used to induce a spurious reference cycle
# inside the Pickler object, that could prevent all serialized objects # 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): for proto in range(0, pickle.HIGHEST_PROTOCOL + 1):
with self.subTest(proto=proto): with self.subTest(proto=proto):

View File

@ -157,7 +157,7 @@ class catch_threading_exception:
Context manager catching threading.Thread exception using Context manager catching threading.Thread exception using
threading.excepthook. threading.excepthook.
Attributes set when an exception is catched: Attributes set when an exception is caught:
* exc_type * exc_type
* exc_value * exc_value

View File

@ -1221,7 +1221,7 @@ def test_channel_list_interpreters_basic(self):
import _xxsubinterpreters as _interpreters import _xxsubinterpreters as _interpreters
obj = _interpreters.channel_recv({cid}) 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) send_interps = interpreters.channel_list_interpreters(cid, send=True)
recv_interps = interpreters.channel_list_interpreters(cid, send=False) recv_interps = interpreters.channel_list_interpreters(cid, send=False)
self.assertEqual(send_interps, [interp0]) self.assertEqual(send_interps, [interp0])

View File

@ -711,7 +711,7 @@ def test_read_all_from_pipe_reader(self):
# See asyncio issue 168. This test is derived from the example # See asyncio issue 168. This test is derived from the example
# subprocess_attach_read_pipe.py, but we configure the # subprocess_attach_read_pipe.py, but we configure the
# StreamReader's limit so that twice it is less than the size # 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. # watcher to the event loop.
code = """\ code = """\

View File

@ -228,7 +228,7 @@ def prepare_broken_pipe_test(self):
# buffer large enough to feed the whole pipe buffer # buffer large enough to feed the whole pipe buffer
large_data = b'x' * support.PIPE_MAX_SIZE 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( proc = self.loop.run_until_complete(
asyncio.create_subprocess_exec( asyncio.create_subprocess_exec(
sys.executable, '-c', 'pass', sys.executable, '-c', 'pass',

View File

@ -3673,7 +3673,7 @@ def test_run_coroutine_threadsafe_with_timeout(self):
self.assertTrue(task.done()) self.assertTrue(task.done())
def test_run_coroutine_threadsafe_task_cancelled(self): 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.""" when the task is cancelled."""
callback = lambda: self.target(cancel=True) callback = lambda: self.target(cancel=True)
future = self.loop.run_in_executor(None, callback) future = self.loop.run_in_executor(None, callback)
@ -3681,7 +3681,7 @@ def test_run_coroutine_threadsafe_task_cancelled(self):
self.loop.run_until_complete(future) self.loop.run_until_complete(future)
def test_run_coroutine_threadsafe_task_factory_exception(self): 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.""" when the task factory raise an exception."""
def task_factory(loop, coro): def task_factory(loop, coro):

View File

@ -264,7 +264,7 @@ def test_return_result_with_error(self):
def test_getitem_with_error(self): def test_getitem_with_error(self):
# Test _Py_CheckSlotResult(). Raise an exception and then calls # 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. # PyObject_GetItem() must not be called with an exception set.
code = textwrap.dedent(""" code = textwrap.dedent("""
import _testcapi import _testcapi

View File

@ -1594,7 +1594,7 @@ def assertSameSet(self, s1, s2):
self.assertSetEqual(set(s1), set(s2)) self.assertSetEqual(set(s1), set(s2))
def test_Set_from_iterable(self): 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): class SetUsingInstanceFromIterable(MutableSet):
def __init__(self, values, created_by): def __init__(self, values, created_by):
if not created_by: if not created_by:

View File

@ -3695,7 +3695,7 @@ class B:
with self.assertRaisesRegex(TypeError, msg): with self.assertRaisesRegex(TypeError, msg):
B(3, 4, 5) 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 @dataclass
class C: class C:
a: int a: int

View File

@ -5723,7 +5723,7 @@ class A(metaclass=M):
def test_incomplete_super(self): 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). its target type can be uninitialized (type->tp_mro == NULL).
""" """
class M(DebugHelperMeta): class M(DebugHelperMeta):

View File

@ -1051,7 +1051,7 @@ def test_splittable_pop(self):
@support.cpython_only @support.cpython_only
def test_splittable_pop_pending(self): 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, b = self.make_shared_key_dict(2)
a['a'] = 4 a['a'] = 4
@ -1398,7 +1398,7 @@ def test_reversed(self):
self.assertRaises(StopIteration, next, r) self.assertRaises(StopIteration, next, r)
def test_reverse_iterator_for_empty_dict(self): 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 # empty dict is directly used for reference count test
self.assertEqual(list(reversed({})), []) self.assertEqual(list(reversed({})), [])

View File

@ -1,5 +1,5 @@
""" """
Test implementation of the PEP 509: dictionary versionning. Test implementation of the PEP 509: dictionary versioning.
""" """
import unittest import unittest
from test.support import import_helper from test.support import import_helper

View File

@ -34,7 +34,7 @@ def normalize_trace_output(output):
return "\n".join(result) return "\n".join(result)
except (IndexError, ValueError): except (IndexError, ValueError):
raise AssertionError( raise AssertionError(
"tracer produced unparseable output:\n{}".format(output) "tracer produced unparsable output:\n{}".format(output)
) )

View File

@ -433,7 +433,7 @@ class TestEmailMessageBase:
--=== --===
Content-Type: text/plain Content-Type: text/plain
Your message has bounced, ser. Your message has bounced, sir.
--=== --===
Content-Type: message/rfc822 Content-Type: message/rfc822

View File

@ -250,7 +250,7 @@ def test_forced_io_encoding(self):
def test_pre_initialization_api(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()). is initialized (via Py_Initialize()).
""" """
env = dict(os.environ, PYTHONPATH=os.pathsep.join(sys.path)) env = dict(os.environ, PYTHONPATH=os.pathsep.join(sys.path))
@ -1157,7 +1157,7 @@ def test_init_setpath_config(self):
'base_prefix': '', 'base_prefix': '',
'exec_prefix': '', 'exec_prefix': '',
'base_exec_prefix': '', 'base_exec_prefix': '',
# overriden by PyConfig # overridden by PyConfig
'program_name': 'conf_program_name', 'program_name': 'conf_program_name',
'base_executable': 'conf_executable', 'base_executable': 'conf_executable',
'executable': 'conf_executable', 'executable': 'conf_executable',

View File

@ -2281,7 +2281,7 @@ def test_range_of_offsets(self):
abcdefg abcdefg
SyntaxError: bad bad SyntaxError: bad bad
""")), """)),
# End offset pass the source lenght # End offset pass the source length
(("bad.py", 1, 2, "abcdefg", 1, 100), (("bad.py", 1, 2, "abcdefg", 1, 100),
dedent( dedent(
""" """

View File

@ -329,7 +329,7 @@ def test_annotations(self):
def test_fstring_debug_annotations(self): def test_fstring_debug_annotations(self):
# f-strings with '=' don't round trip very well, so set the expected # 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=!r}'", expected="f'x={x!r}'")
self.assertAnnotationEqual("f'{x=:}'", expected="f'x={x:}'") self.assertAnnotationEqual("f'{x=:}'", expected="f'x={x:}'")
self.assertAnnotationEqual("f'{x=:.2f}'", expected="f'x={x:.2f}'") self.assertAnnotationEqual("f'{x=:.2f}'", expected="f'x={x:.2f}'")

View File

@ -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 # If this test fails, it will reproduce a crash reported as
# bpo-34113. The crash happened at the command line console of # bpo-34113. The crash happened at the command line console of
# debug Python builds with __ltrace__ enabled (only possible in console), # 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: with open(os_helper.TESTFN, 'w', encoding='utf-8') as fd:
self.addCleanup(os_helper.unlink, os_helper.TESTFN) self.addCleanup(os_helper.unlink, os_helper.TESTFN)
fd.write(textwrap.dedent("""\ fd.write(textwrap.dedent("""\

View File

@ -496,7 +496,7 @@ def test_japanese(self):
class TestMiscellaneous(unittest.TestCase): class TestMiscellaneous(unittest.TestCase):
def test_defaults_UTF8(self): def test_defaults_UTF8(self):
# Issue #18378: on (at least) macOS setting LC_CTYPE to "UTF-8" is # 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). # during interpreter startup (on macOS).
import _locale import _locale
import os import os

View File

@ -324,7 +324,7 @@ def test_match_common(self):
self.assertFalse(P('b/py').match('b.py')) self.assertFalse(P('b/py').match('b.py'))
self.assertFalse(P('/a.py').match('b.py')) self.assertFalse(P('/a.py').match('b.py'))
self.assertFalse(P('b.py/c').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('b.py').match('*.py'))
self.assertTrue(P('a/b.py').match('*.py')) self.assertTrue(P('a/b.py').match('*.py'))
self.assertTrue(P('/a/b.py').match('*.py')) self.assertTrue(P('/a/b.py').match('*.py'))
@ -1284,7 +1284,7 @@ def test_is_reserved(self):
self.assertIs(False, P('/foo/bar').is_reserved()) self.assertIs(False, P('/foo/bar').is_reserved())
# UNC paths are never reserved. # UNC paths are never reserved.
self.assertIs(False, P('//my/share/nul/con/aux').is_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('nul').is_reserved())
self.assertIs(True, P('aux').is_reserved()) self.assertIs(True, P('aux').is_reserved())
self.assertIs(True, P('prn').is_reserved()) self.assertIs(True, P('prn').is_reserved())

View File

@ -114,7 +114,7 @@ def strftest1(self, now):
) )
for e in expectations: for e in expectations:
# musn't raise a value error # mustn't raise a value error
try: try:
result = time.strftime(e[0], now) result = time.strftime(e[0], now)
except ValueError as error: except ValueError as error:

View File

@ -379,7 +379,7 @@ def g456():
self.assertTrue(frame is sys._getframe()) self.assertTrue(frame is sys._getframe())
# Verify that the captured thread frame is blocked in g456, called # 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. # threading.py are also in the thread's call stack.
frame = d.pop(thread_id) frame = d.pop(thread_id)
stack = traceback.extract_stack(frame) stack = traceback.extract_stack(frame)
@ -446,7 +446,7 @@ def g456():
self.assertEqual((None, None, None), d.pop(main_id)) self.assertEqual((None, None, None), d.pop(main_id))
# Verify that the captured thread frame is blocked in g456, called # 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. # threading.py are also in the thread's call stack.
exc_type, exc_value, exc_tb = d.pop(thread_id) exc_type, exc_value, exc_tb = d.pop(thread_id)
stack = traceback.extract_stack(exc_tb.tb_frame) stack = traceback.extract_stack(exc_tb.tb_frame)

View File

@ -1435,7 +1435,7 @@ def test_explict_cleanup_ignore_errors(self):
self.assertEqual( self.assertEqual(
temp_path.exists(), temp_path.exists(),
sys.platform.startswith("win"), sys.platform.startswith("win"),
f"TemporaryDirectory {temp_path!s} existance state unexpected") f"TemporaryDirectory {temp_path!s} existence state unexpected")
temp_dir.cleanup() temp_dir.cleanup()
self.assertFalse( self.assertFalse(
temp_path.exists(), temp_path.exists(),
@ -1494,7 +1494,7 @@ def test_del_on_collection_ignore_errors(self):
self.assertEqual( self.assertEqual(
temp_path.exists(), temp_path.exists(),
sys.platform.startswith("win"), 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): def test_del_on_shutdown(self):
# A TemporaryDirectory may be cleaned up during shutdown # A TemporaryDirectory may be cleaned up during shutdown
@ -1559,7 +1559,7 @@ def test_del_on_shutdown_ignore_errors(self):
self.assertEqual( self.assertEqual(
temp_path.exists(), temp_path.exists(),
sys.platform.startswith("win"), 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') err = err.decode('utf-8', 'backslashreplace')
self.assertNotIn("Exception", err) self.assertNotIn("Exception", err)
self.assertNotIn("Error", err) self.assertNotIn("Error", err)

View File

@ -436,8 +436,8 @@ def test_mktime(self):
@unittest.skipUnless(platform.libc_ver()[0] != 'glibc', @unittest.skipUnless(platform.libc_ver()[0] != 'glibc',
"disabled because of a bug in glibc. Issue #13309") "disabled because of a bug in glibc. Issue #13309")
def test_mktime_error(self): def test_mktime_error(self):
# It may not be possible to reliably make mktime return error # It may not be possible to reliably make mktime return an error
# on all platfom. This will make sure that no other exception # on all platforms. This will make sure that no other exception
# than OverflowError is raised for an extreme value. # than OverflowError is raised for an extreme value.
tt = time.gmtime(self.t) tt = time.gmtime(self.t)
tzname = time.strftime('%Z', tt) tzname = time.strftime('%Z', tt)

View File

@ -408,7 +408,7 @@ def test_type_ignore(self):
class CosmeticTestCase(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): def test_simple_expressions_parens(self):
self.check_src_roundtrip("(a := b)") self.check_src_roundtrip("(a := b)")

View File

@ -1472,7 +1472,7 @@ def check_weak_del_and_len_while_iterating(self, dict, testcontext):
o = Object(123456) o = Object(123456)
with testcontext(): with testcontext():
n = len(dict) 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())) dict.pop(next(dict.keys()))
self.assertEqual(len(dict), n - 1) self.assertEqual(len(dict), n - 1)
dict[o] = o dict[o] = o

View File

@ -580,7 +580,7 @@ def testEnviron(self):
# Test handler.environ as a dict # Test handler.environ as a dict
expected = {} expected = {}
setup_testing_defaults(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) # by SimpleHandler.add_cgi_vars() (SimpleHandler.base_env)
for key, value in os_environ.items(): for key, value in os_environ.items():
if key not in expected: if key not in expected:

View File

@ -3331,7 +3331,7 @@ class MyElement(ET.Element):
self._check_element_factory_class(MyElement) self._check_element_factory_class(MyElement)
def test_element_factory_pure_python_subclass(self): 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 # TreeBuilder should be able to cope with a subclass of the
# pure Python Element class. # pure Python Element class.
base = ET._Element_Py base = ET._Element_Py

View File

@ -561,7 +561,7 @@ def test_comparison(self):
class BinaryTestCase(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 # for now (i.e. interpreting the binary data as Latin-1-encoded
# text). But this feels very unsatisfactory. Perhaps we should # text). But this feels very unsatisfactory. Perhaps we should
# only define repr(), and return r"Binary(b'\xff')" instead? # only define repr(), and return r"Binary(b'\xff')" instead?

View File

@ -1556,7 +1556,7 @@ def _shutdown():
break break
for lock in locks: for lock in locks:
# mimick Thread.join() # mimic Thread.join()
lock.acquire() lock.acquire()
lock.release() lock.release()

View File

@ -2736,7 +2736,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. """Add tag NEWTAG to item which is closest to pixel at X, Y.
If several match take the top-most. If several match take the top-most.
All items closer than HALO are considered overlapping (all are 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) self.addtag(newtag, 'closest', x, y, halo, start)
def addtag_enclosed(self, newtag, x1, y1, x2, y2): def addtag_enclosed(self, newtag, x1, y1, x2, y2):
@ -3331,7 +3331,7 @@ def add_command(self, cnf={}, **kw):
self.add('command', cnf or kw) self.add('command', cnf or kw)
def add_radiobutton(self, cnf={}, **kw): def add_radiobutton(self, cnf={}, **kw):
"""Addd radio menu item.""" """Add radio menu item."""
self.add('radiobutton', cnf or kw) self.add('radiobutton', cnf or kw)
def add_separator(self, cnf={}, **kw): def add_separator(self, cnf={}, **kw):
@ -3356,7 +3356,7 @@ def insert_command(self, index, cnf={}, **kw):
self.insert(index, 'command', cnf or kw) self.insert(index, 'command', cnf or kw)
def insert_radiobutton(self, index, cnf={}, **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) self.insert(index, 'radiobutton', cnf or kw)
def insert_separator(self, index, cnf={}, **kw): def insert_separator(self, index, cnf={}, **kw):

View File

@ -968,7 +968,7 @@ def test_add_and_hidden(self):
tabs = self.nb.tabs() tabs = self.nb.tabs()
curr = self.nb.index('current') 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) child2_index = self.nb.index(self.child2)
self.nb.hide(self.child2) self.nb.hide(self.child2)
self.nb.add(self.child2) self.nb.add(self.child2)

View File

@ -52,7 +52,7 @@ def addAsyncCleanup(self, func, /, *args, **kwargs):
# We intentionally don't add inspect.iscoroutinefunction() check # We intentionally don't add inspect.iscoroutinefunction() check
# for func argument because there is no way # for func argument because there is no way
# to check for async function reliably: # 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 # 2. Class can implement "async def __call__()" method
# 3. Regular "def func()" that returns awaitable object # 3. Regular "def func()" that returns awaitable object
self.addCleanup(*(func, *args), **kwargs) self.addCleanup(*(func, *args), **kwargs)

View File

@ -128,7 +128,7 @@ def test_integration_with_spec_att_definition(self):
m.attr_sample2 m.attr_sample2
def test_integration_with_spec_method_definition(self): 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 = mock.Mock(SampleObject)
m.method_sample1.return_value = 1 m.method_sample1.return_value = 1

View File

@ -202,7 +202,7 @@ else {
$Prompt = $pyvenvCfg['prompt']; $Prompt = $pyvenvCfg['prompt'];
} }
else { 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)'" Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
$Prompt = Split-Path -Path $venvDir -Leaf $Prompt = Split-Path -Path $venvDir -Leaf
} }

View File

@ -137,7 +137,7 @@ def validator(application):
""" """
When applied between a WSGI server and a WSGI application, this 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 This middleware does not modify the request or response in any
way, but will raise an AssertionError if anything seems off way, but will raise an AssertionError if anything seems off
(except for a failure to close the application iterator, which (except for a failure to close the application iterator, which

View File

@ -338,7 +338,7 @@ def _utcoff_to_dstoff(trans_idx, utcoffsets, isdsts):
comp_idx = trans_idx[i + 1] comp_idx = trans_idx[i + 1]
# If the following transition is also DST and we couldn't # 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 # skip it and hope this transition gets assigned later
if isdsts[comp_idx]: if isdsts[comp_idx]:
continue continue