From 50c5546e05e7a2c1563752ca3ae6570bbed57736 Mon Sep 17 00:00:00 2001
From: Emil Berg Key bindingsControl key on Windows and
-Unix and the Command key on macOS. (And all such dicussions
+Unix and the Command key on macOS. (And all such discussions
assume that the keys have not been re-bound to something else.)
Arrow keys move the cursor one character or line.
C-c attemps to interrupt statement execution (but may fail).
C-c attempts to interrupt statement execution (but may fail).
C-d closes Shell if typed at a >>>
prompt.
Alt-p and Alt-n (C-p and C-n on macOS)
retrieve to the current prompt the previous or next previously
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
index 8f98e73258e778..a30db99a619a93 100644
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -108,11 +108,11 @@ def handle_tk_events(tcl=tcl):
# Thread shared globals: Establish a queue between a subthread (which handles
# the socket) and the main thread (which runs user code), plus global
-# completion, exit and interruptable (the main thread) flags:
+# completion, exit and interruptible (the main thread) flags:
exit_now = False
quitting = False
-interruptable = False
+interruptible = False
def main(del_exitfunc=False):
"""Start the Python execution server in a subprocess
@@ -582,14 +582,14 @@ def __init__(self, rpchandler):
self.locals = {}
def runcode(self, code):
- global interruptable
+ global interruptible
try:
self.user_exc_info = None
- interruptable = True
+ interruptible = True
try:
exec(code, self.locals)
finally:
- interruptable = False
+ interruptible = False
except SystemExit as e:
if e.args: # SystemExit called with an argument.
ob = e.args[0]
@@ -615,7 +615,7 @@ def runcode(self, code):
flush_stdout()
def interrupt_the_server(self):
- if interruptable:
+ if interruptible:
thread.interrupt_main()
def start_the_debugger(self, gui_adap_oid):
diff --git a/Lib/pdb.py b/Lib/pdb.py
index d9aed24bfcd8e7..34066f7b040082 100644
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -2428,7 +2428,7 @@ def main():
formatter_class=argparse.RawDescriptionHelpFormatter,
allow_abbrev=False)
- # We need to maunally get the script from args, because the first positional
+ # We need to manually get the script from args, because the first positional
# arguments could be either the script we need to debug, or the argument
# to the -m module
parser.add_argument('-c', '--command', action='append', default=[], metavar='command', dest='commands',
diff --git a/Lib/shutil.py b/Lib/shutil.py
index dd3e0e0c5da54b..c71bc24a5eff41 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -82,7 +82,7 @@ class RegistryError(Exception):
"""Raised when a registry operation with the archiving
and unpacking registries fails"""
-class _GiveupOnFastCopy(Exception):
+class _GiveUpOnFastCopy(Exception):
"""Raised as a signal to fallback on using raw read()/write()
file copy when fast-copy functions fail to do so.
"""
@@ -95,7 +95,7 @@ def _fastcopy_fcopyfile(fsrc, fdst, flags):
infd = fsrc.fileno()
outfd = fdst.fileno()
except Exception as err:
- raise _GiveupOnFastCopy(err) # not a regular file
+ raise _GiveUpOnFastCopy(err) # not a regular file
try:
posix._fcopyfile(infd, outfd, flags)
@@ -103,7 +103,7 @@ def _fastcopy_fcopyfile(fsrc, fdst, flags):
err.filename = fsrc.name
err.filename2 = fdst.name
if err.errno in {errno.EINVAL, errno.ENOTSUP}:
- raise _GiveupOnFastCopy(err)
+ raise _GiveUpOnFastCopy(err)
else:
raise err from None
@@ -126,7 +126,7 @@ def _fastcopy_sendfile(fsrc, fdst):
infd = fsrc.fileno()
outfd = fdst.fileno()
except Exception as err:
- raise _GiveupOnFastCopy(err) # not a regular file
+ raise _GiveUpOnFastCopy(err) # not a regular file
# Hopefully the whole file will be copied in a single call.
# sendfile() is called in a loop 'till EOF is reached (0 return)
@@ -156,14 +156,14 @@ def _fastcopy_sendfile(fsrc, fdst):
# does not support copies between regular files (only
# sockets).
_USE_CP_SENDFILE = False
- raise _GiveupOnFastCopy(err)
+ raise _GiveUpOnFastCopy(err)
if err.errno == errno.ENOSPC: # filesystem is full
raise err from None
# Give up on first call and if no data was copied.
if offset == 0 and os.lseek(outfd, 0, os.SEEK_CUR) == 0:
- raise _GiveupOnFastCopy(err)
+ raise _GiveUpOnFastCopy(err)
raise err
else:
@@ -263,14 +263,14 @@ def copyfile(src, dst, *, follow_symlinks=True):
try:
_fastcopy_fcopyfile(fsrc, fdst, posix._COPYFILE_DATA)
return dst
- except _GiveupOnFastCopy:
+ except _GiveUpOnFastCopy:
pass
# Linux / Android / Solaris
elif _USE_CP_SENDFILE:
try:
_fastcopy_sendfile(fsrc, fdst)
return dst
- except _GiveupOnFastCopy:
+ except _GiveUpOnFastCopy:
pass
# Windows, see:
# https://github.com/python/cpython/pull/7160#discussion_r195405230
diff --git a/Lib/test/decimaltestdata/ddQuantize.decTest b/Lib/test/decimaltestdata/ddQuantize.decTest
index e1c5674d9ac042..636bac40927428 100644
--- a/Lib/test/decimaltestdata/ddQuantize.decTest
+++ b/Lib/test/decimaltestdata/ddQuantize.decTest
@@ -462,7 +462,7 @@ ddqua520 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
ddqua521 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
ddqua522 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
ddqua523 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
--- next four are "won't fit" overflow
+-- next four are "won't fit" overflows
ddqua526 quantize 1.234 1e-299 -> NaN Invalid_operation
ddqua527 quantize 123.456 1e-299 -> NaN Invalid_operation
ddqua528 quantize 1.234 1e-299 -> NaN Invalid_operation
diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py
index d6be4ad049d14a..32a88ca514d01b 100644
--- a/Lib/test/libregrtest/utils.py
+++ b/Lib/test/libregrtest/utils.py
@@ -37,7 +37,7 @@
# Other resources excluded from --use=all:
#
-# - extralagefile (ex: test_zipfile64): really too slow to be enabled
+# - extralargefile (ex: test_zipfile64): really too slow to be enabled
# "by default"
# - tzdata: while needed to validate fully test_datetime, it makes
# test_datetime too slow (15-20 min on some buildbots) and so is disabled by
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index d768bead7120c7..4fc51a53c12f9c 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -2203,7 +2203,7 @@ def wait_process(pid, *, exitcode, timeout=None):
pid2, status = os.waitpid(pid, os.WNOHANG)
if pid2 != 0:
break
- # rety: the process is still running
+ # retry: the process is still running
else:
try:
os.kill(pid, signal.SIGKILL)
@@ -2570,7 +2570,7 @@ class CPUStopwatch:
N.B.:
- This *includes* time spent in other threads.
- Some systems only have a coarse resolution; check
- stopwatch.clock_info.rseolution if.
+ stopwatch.clock_info.resolution if.
Usage:
diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py
index 78692fd3474782..cc7a4b1463b9b7 100644
--- a/Lib/test/test_argparse.py
+++ b/Lib/test/test_argparse.py
@@ -2862,7 +2862,7 @@ def test_single_parent_mutex(self):
parser = ErrorRaisingArgumentParser(parents=[self.ab_mutex_parent])
self._test_mutex_ab(parser.parse_args)
- def test_single_granparent_mutex(self):
+ def test_single_grandparent_mutex(self):
parents = [self.ab_mutex_parent]
parser = ErrorRaisingArgumentParser(add_help=False, parents=parents)
parser = ErrorRaisingArgumentParser(parents=[parser])
diff --git a/Lib/test/test_asyncio/test_locks.py b/Lib/test/test_asyncio/test_locks.py
index c3bff760f7307e..616e631058f1cd 100644
--- a/Lib/test/test_asyncio/test_locks.py
+++ b/Lib/test/test_asyncio/test_locks.py
@@ -784,8 +784,8 @@ async def func():
# originally raised.
self.assertIs(err.exception, raised)
- async def test_cancelled_error_re_aquire(self):
- # Test that a cancelled error, received when re-aquiring lock,
+ async def test_cancelled_error_re_acquire(self):
+ # Test that a cancelled error, received when re-acquiring lock,
# will be re-raised un-modified.
wake = False
raised = None
@@ -846,7 +846,7 @@ async def consumer():
c[0].cancel()
# now wait for the item to be consumed
- # if it doesn't means that our "notify" didn"t take hold.
+ # if it doesn't means that our "notify" didn't take hold.
# because it raced with a cancel()
try:
async with asyncio.timeout(0.01):
@@ -886,7 +886,7 @@ async def consumer():
condition.notify(1)
# now we sleep for a bit. This allows the target task to wake up and
- # settle on re-aquiring the lock
+ # settle on re-acquiring the lock
await asyncio.sleep(0)
# Cancel it while awaiting the lock
@@ -894,7 +894,7 @@ async def consumer():
c[0].cancel()
# now wait for the item to be consumed
- # if it doesn't means that our "notify" didn"t take hold.
+ # if it doesn't means that our "notify" didn't take hold.
# because it raced with a cancel()
try:
async with asyncio.timeout(0.01):
diff --git a/Lib/test/test_capi/test_misc.py b/Lib/test/test_capi/test_misc.py
index 5c6faa1626d380..b1f3cd380d91e7 100644
--- a/Lib/test/test_capi/test_misc.py
+++ b/Lib/test/test_capi/test_misc.py
@@ -2106,7 +2106,7 @@ async def foo(arg): return await arg # Py 3.5
self.assertEqual(ret, 0)
self.assertEqual(pickle.load(f), {'a': '123x', 'b': '123'})
- def test_py_config_isoloated_per_interpreter(self):
+ def test_py_config_isolated_per_interpreter(self):
# A config change in one interpreter must not leak to out to others.
#
# This test could verify ANY config value, it just happens to have been
diff --git a/Lib/test/test_capi/test_opt.py b/Lib/test/test_capi/test_opt.py
index f1ab72180d714d..b8b7328b1c79a5 100644
--- a/Lib/test/test_capi/test_opt.py
+++ b/Lib/test/test_capi/test_opt.py
@@ -1432,7 +1432,7 @@ class Foo:
self.assertIsNotNone(ex)
self.assertEqual(res, 200)
guard_type_version_count = opnames.count("_GUARD_TYPE_VERSION")
- # Note: This will actually be 1 for noe
+ # Note: This will actually be 1 for now
# https://github.com/python/cpython/pull/119365#discussion_r1626220129
self.assertEqual(guard_type_version_count, 2)
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index 35725718152c56..cc976c1b663f8f 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -470,7 +470,7 @@ def test_output_newline(self):
self.assertEqual(b'1\n2\n', out)
self.assertEqual(b'3\n4\n', err)
- def test_unmached_quote(self):
+ def test_unmatched_quote(self):
# Issue #10206: python program starting with unmatched quote
# spewed spaces to stdout
rc, out, err = assert_python_failure('-c', "'")
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py
index 3a5a8abf81e43d..fefcd44365f552 100644
--- a/Lib/test/test_cmd_line_script.py
+++ b/Lib/test/test_cmd_line_script.py
@@ -503,7 +503,7 @@ def test_dash_m_bad_pyc(self):
self.assertNotIn(b'is a package', err)
self.assertNotIn(b'Traceback', err)
- def test_hint_when_triying_to_import_a_py_file(self):
+ def test_hint_when_trying_to_import_a_py_file(self):
with os_helper.temp_dir() as script_dir, \
os_helper.change_cwd(path=script_dir):
# Create invalid *.pyc as empty file
diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py
index ba77e1c5341db8..6557464913a3fe 100644
--- a/Lib/test/test_code.py
+++ b/Lib/test/test_code.py
@@ -698,7 +698,7 @@ def dedup(lst, prev=object()):
yield item
prev = item
-def lines_from_postions(positions):
+def lines_from_positions(positions):
return dedup(l for (l, _, _, _) in positions)
def misshappen():
@@ -759,7 +759,7 @@ def check_lines(self, func):
co = func.__code__
lines1 = [line for _, _, line in co.co_lines()]
self.assertEqual(lines1, list(dedup(lines1)))
- lines2 = list(lines_from_postions(positions_from_location_table(co)))
+ lines2 = list(lines_from_positions(positions_from_location_table(co)))
for l1, l2 in zip(lines1, lines2):
self.assertEqual(l1, l2)
self.assertEqual(len(lines1), len(lines2))
diff --git a/Lib/test/test_concurrent_futures/test_process_pool.py b/Lib/test/test_concurrent_futures/test_process_pool.py
index 8b1bdaa33d8f5c..1e7735f4376f81 100644
--- a/Lib/test/test_concurrent_futures/test_process_pool.py
+++ b/Lib/test/test_concurrent_futures/test_process_pool.py
@@ -86,7 +86,7 @@ def test_traceback(self):
f1.getvalue())
@hashlib_helper.requires_hashdigest('md5')
- def test_ressources_gced_in_workers(self):
+ def test_resources_gced_in_workers(self):
# Ensure that argument for a job are correctly gc-ed after the job
# is finished
mgr = self.get_context().Manager()
diff --git a/Lib/test/test_context.py b/Lib/test/test_context.py
index b06b9df9f5b0b8..ac3974aafe2b7e 100644
--- a/Lib/test/test_context.py
+++ b/Lib/test/test_context.py
@@ -418,7 +418,7 @@ def __eq__(self, other):
return super().__eq__(other)
-class HaskKeyCrasher:
+class HashKeyCrasher:
def __init__(self, *, error_on_hash=False, error_on_eq=False):
self.error_on_hash = error_on_hash
self.error_on_eq = error_on_eq
@@ -595,14 +595,14 @@ def test_hamt_stress(self):
key = KeyStr(i)
if not (i % CRASH_HASH_EVERY):
- with HaskKeyCrasher(error_on_hash=True):
+ with HashKeyCrasher(error_on_hash=True):
with self.assertRaises(HashingError):
h.set(key, i)
h = h.set(key, i)
if not (i % CRASH_EQ_EVERY):
- with HaskKeyCrasher(error_on_eq=True):
+ with HashKeyCrasher(error_on_eq=True):
with self.assertRaises(EqError):
h.get(KeyStr(i)) # really trigger __eq__
@@ -624,12 +624,12 @@ def test_hamt_stress(self):
key = KeyStr(i)
if not (iter_i % CRASH_HASH_EVERY):
- with HaskKeyCrasher(error_on_hash=True):
+ with HashKeyCrasher(error_on_hash=True):
with self.assertRaises(HashingError):
h.delete(key)
if not (iter_i % CRASH_EQ_EVERY):
- with HaskKeyCrasher(error_on_eq=True):
+ with HashKeyCrasher(error_on_eq=True):
with self.assertRaises(EqError):
h.delete(KeyStr(i))
@@ -1078,11 +1078,11 @@ def test_hamt_in_1(self):
self.assertFalse(B in h)
with self.assertRaises(EqError):
- with HaskKeyCrasher(error_on_eq=True):
+ with HashKeyCrasher(error_on_eq=True):
AA in h
with self.assertRaises(HashingError):
- with HaskKeyCrasher(error_on_hash=True):
+ with HashKeyCrasher(error_on_hash=True):
AA in h
def test_hamt_getitem_1(self):
@@ -1101,11 +1101,11 @@ def test_hamt_getitem_1(self):
h[B]
with self.assertRaises(EqError):
- with HaskKeyCrasher(error_on_eq=True):
+ with HashKeyCrasher(error_on_eq=True):
h[AA]
with self.assertRaises(HashingError):
- with HaskKeyCrasher(error_on_hash=True):
+ with HashKeyCrasher(error_on_hash=True):
h[AA]
diff --git a/Lib/test/test_csv.py b/Lib/test/test_csv.py
index ce5c03659f1979..e266f0927b0627 100644
--- a/Lib/test/test_csv.py
+++ b/Lib/test/test_csv.py
@@ -512,7 +512,7 @@ def test_read_linenum(self):
self.assertRaises(StopIteration, next, r)
self.assertEqual(r.line_num, 3)
- def test_roundtrip_quoteed_newlines(self):
+ def test_roundtrip_quoted_newlines(self):
rows = [
['\na', 'b\nc', 'd\n'],
['\re', 'f\rg', 'h\r'],
diff --git a/Lib/test/test_dataclasses/__init__.py b/Lib/test/test_dataclasses/__init__.py
index 2e6c49e29ce828..9167fd8b0a501e 100644
--- a/Lib/test/test_dataclasses/__init__.py
+++ b/Lib/test/test_dataclasses/__init__.py
@@ -2918,7 +2918,7 @@ class C:
class D(C):
j: int
- def test_inherit_frozen_mutliple_inheritance(self):
+ def test_inherit_frozen_multiple_inheritance(self):
@dataclass
class NotFrozen:
pass
@@ -2960,7 +2960,7 @@ class NotFrozenChild(*bases):
class FrozenChild(*bases):
pass
- def test_inherit_frozen_mutliple_inheritance_regular_mixins(self):
+ def test_inherit_frozen_multiple_inheritance_regular_mixins(self):
@dataclass(frozen=True)
class Frozen:
pass
diff --git a/Lib/test/test_doctest/test_doctest2.txt b/Lib/test/test_doctest/test_doctest2.txt
index 76dab94a9c0470..d9dc859fc341dc 100644
--- a/Lib/test/test_doctest/test_doctest2.txt
+++ b/Lib/test/test_doctest/test_doctest2.txt
@@ -10,5 +10,5 @@ This test also has some (random) encoded (utf-8) unicode text:
ÐÐÐÐÐ
-This doesn't cause a problem in the tect surrounding the examples, but
+This doesn't cause a problem in the test surrounding the examples, but
we include it here (in this test text file) to make sure. :)
diff --git a/Lib/test/test_email/test__header_value_parser.py b/Lib/test/test_email/test__header_value_parser.py
index 95224e19f67ce5..6a5bb421f50477 100644
--- a/Lib/test/test_email/test__header_value_parser.py
+++ b/Lib/test/test_email/test__header_value_parser.py
@@ -1015,7 +1015,7 @@ def test_get_phrase_obsolete(self):
self.assertEqual(len(phrase), 7)
self.assertEqual(phrase[3].comments, ['weird'])
- def test_get_phrase_pharse_must_start_with_word(self):
+ def test_get_phrase_phrase_must_start_with_word(self):
phrase = self._test_get_x(parser.get_phrase,
'(even weirder).name',
'(even weirder).name',
@@ -1422,7 +1422,7 @@ def test_get_addr_spec_normal(self):
self.assertEqual(addr_spec.domain, 'example.com')
self.assertEqual(addr_spec.addr_spec, 'dinsdale@example.com')
- def test_get_addr_spec_with_doamin_literal(self):
+ def test_get_addr_spec_with_domain_literal(self):
addr_spec = self._test_get_x(parser.get_addr_spec,
'dinsdale@[127.0.0.1]',
'dinsdale@[127.0.0.1]',
@@ -1444,7 +1444,7 @@ def test_get_addr_spec_with_cfws(self):
self.assertEqual(addr_spec.domain, 'example.com')
self.assertEqual(addr_spec.addr_spec, 'dinsdale@example.com')
- def test_get_addr_spec_with_qouoted_string_and_cfws(self):
+ def test_get_addr_spec_with_quoted_string_and_cfws(self):
addr_spec = self._test_get_x(parser.get_addr_spec,
'(foo) "roy a bug"(bar)@ (bird) example.com (bog)',
'(foo) "roy a bug"(bar)@ (bird) example.com (bog)',
@@ -2290,7 +2290,7 @@ def test_get_group_one_invalid(self):
self.assertEqual(group.mailboxes[1].local_part, 'x')
self.assertIsNone(group.all_mailboxes[1].display_name)
- def test_get_group_missing_final_semicol(self):
+ def test_get_group_missing_final_semicolon(self):
group = self._test_get_x(parser.get_group,
('Monty Python:"Fred A. Bear"