8000 Fix typos mostly in comments, docs and test names (GH-15209) · python/cpython@39d87b5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 39d87b5

Browse files
minho42terryjreedy
authored andcommitted
Fix typos mostly in comments, docs and test names (GH-15209)
1 parent 15119bc commit 39d87b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+60
-60
lines changed

Doc/c-api/init_config.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ Path Configuration
876876
If at least one "output field" is not set, Python computes the path
877877
configuration to fill unset fields. If
878878
:c:member:`~PyConfig.module_search_paths_set` is equal to 0,
879-
:c:member:`~PyConfig.module_search_paths` is overriden and
879+
:c:member:`~PyConfig.module_search_paths` is overridden and
880880
:c:member:`~PyConfig.module_search_paths_set` is set to 1.
881881
882882
It is possible to completely ignore the function computing the default

Doc/library/importlib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,8 +1379,8 @@ an :term:`importer`.
13791379
bytecode file. An empty string represents no optimization, so
13801380
``/foo/bar/baz.py`` with an *optimization* of ``''`` will result in a
13811381
bytecode path of ``/foo/bar/__pycache__/baz.cpython-32.pyc``. ``None`` causes
1382-
the interpter's optimization level to be used. Any other value's string
1383-
representation being used, so ``/foo/bar/baz.py`` with an *optimization* of
1382+
the interpreter's optimization level to be used. Any other value's string
1383+
representation is used, so ``/foo/bar/baz.py`` with an *optimization* of
13841384
``2`` will lead to the bytecode path of
13851385
``/foo/bar/__pycache__/baz.cpython-32.opt-2.pyc``. The string representation
13861386
of *optimization* can only be alphanumeric, else :exc:`ValueError` is raised.

Include/pyhash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ PyAPI_FUNC(PyHash_FuncDef*) PyHash_GetFuncDef(void);
119119
* configure script.
120120
*
121121
* - FNV is available on all platforms and architectures.
122-
* - SIPHASH24 only works on plaforms that don't require aligned memory for integers.
122+
* - SIPHASH24 only works on platforms that don't require aligned memory for integers.
123123
* - With EXTERNAL embedders can provide an alternative implementation with::
124124
*
125125
* PyHash_FuncDef PyHash_Func = {...};

Lib/asyncio/streams.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def connect(host=None, port=None, *,
7171
ssl_handshake_timeout=None,
7272
happy_eyeballs_delay=None, interleave=None):
7373
# Design note:
74-
# Don't use decorator approach but exilicit non-async
74+
# Don't use decorator approach but explicit non-async
7575
# function to fail fast and explicitly
7676
# if passed arguments don't match the function signature
7777
return _ContextManagerHelper(_connect(host, port, limit,
@@ -442,7 +442,7 @@ def connect_unix(path=None, *,
442442
ssl_handshake_timeout=None):
443443
"""Similar to `connect()` but works with UNIX Domain Sockets."""
444444
# Design note:
445-
# Don't use decorator approach but exilicit non-async
445+
# Don't use decorator approach but explicit non-async
446446
# function to fail fast and explicitly
447447
# if passed arguments don't match the function signature
448448
return _ContextManagerHelper(_connect_unix(path,

Lib/bdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def canonic(self, filename):
3838
"""Return canonical form of filename.
3939
4040
For real filenames, the canonical form is a case-normalized (on
41-
case insenstive filesystems) absolute path. 'Filenames' with
41+
case insensitive filesystems) absolute path. 'Filenames' with
4242
angle brackets, such as "<stdin>", generated in interactive
4343
mode, are returned unchanged.
4444
"""

Lib/multiprocessing/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def __repr__(self):
238238
if self._kwargs:
239239
x += ', kwargs=' + str(self._kwargs)
240240
if self._key[0] is not None:
241-
x += ', exitprority=' + str(self._key[0])
241+
x += ', exitpriority=' + str(self._key[0])
242242
return x + '>'
243243

244244

Lib/test/lock_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def _check_notify(self, cond):
467467
# of the workers.
468468
# Secondly, this test assumes that condition variables are not subject
469469
# to spurious wakeups. The absence of spurious wakeups is an implementation
470-
# detail of Condition Cariables in current CPython, but in general, not
470+
# detail of Condition Variables in current CPython, but in general, not
471471
# a guaranteed property of condition variables as a programming
472472
# construct. In particular, it is possible that this can no longer
473473
# be conveniently guaranteed should their implementation ever change.

Lib/test/test_cmd_line_script.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ def test_dash_m_errors(self):
474474
('os.path', br'loader.*cannot handle'),
475475
('importlib', br'No module named.*'
476476
br'is a package and cannot be directly executed'),
477-
('importlib.nonexistant', br'No module named'),
477+
('importlib.nonexistent', br'No module named'),
478478
('.unittest', br'Relative module names not supported'),
479479
)
480480
for name, regex in tests:

Lib/test/test_collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,7 @@ def test_order_preservation(self):
19271927
'r', 'c', 'd', ' ', 's', 's', 'i', 'i', 'm', 'm', 'l'])
19281928

19291929
# Math operations order first by the order encountered in the left
1930-
# operand and then by the order encounted in the right operand.
1930+
# operand and then by the order encountered in the right operand.
19311931
ps = 'aaabbcdddeefggghhijjjkkl'
19321932
qs = 'abbcccdeefffhkkllllmmnno'
19331933
order = {letter: i for i, letter in enumerate(dict.fromkeys(ps + qs))}

Lib/test/test_descr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3025,7 +3025,7 @@ def test_str_subclass_as_dict_key(self):
30253025
# Testing a str subclass used as dict key ..
30263026

30273027
class cistr(str):
3028-
"""Sublcass of str that computes __eq__ case-insensitively.
3028+
"""Subclass of str that computes __eq__ case-insensitively.
30293029
30303030
Also computes a hash code of the string in canonical form.
30313031
"""

Lib/test/test_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def testformat(formatstr, args, output=None, limit=None, overflowok=False):
4848

4949
def testcommon(formatstr, args, output=None, limit=None, overflowok=False):
5050
# if formatstr is a str, test str, bytes, and bytearray;
51-
# otherwise, test bytes and bytearry
51+
# otherwise, test bytes and bytearray
5252
if isinstance(formatstr, str):
5353
testformat(formatstr, args, output, limit, overflowok)
5454
b_format = formatstr.encode('ascii')

Lib/test/test_gc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ def test_collect_generation(self):
912912
def test_collect_garbage(self):
913913
self.preclean()
914914
# Each of these cause four objects to be garbage: Two
915-
# Uncolectables and their instance dicts.
915+
# Uncollectables and their instance dicts.
916916
Uncollectable()
917917
Uncollectable()
918918
C1055820(666)

Lib/test/test_hmac.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def test_compare_digest(self):
445445
a, b = bytearray(b"foobar"), bytearray(b"foobar")
446446
self.assertTrue(hmac.compare_digest(a, b))
447447

448-
# Testing bytearrays of diffeent lengths
448+
# Testing bytearrays of different lengths
449449
a, b = bytearray(b"foobar"), bytearray(b"foo")
450450
self.assertFalse(hmac.compare_digest(a, b))
451451

@@ -458,7 +458,7 @@ def test_compare_digest(self):
458458
self.assertTrue(hmac.compare_digest(a, b))
459459
self.assertTrue(hmac.compare_digest(b, a))
460460

461-
# Testing byte bytearray of diffeent lengths
461+
# Testing byte bytearray of different lengths
462462
a, b = bytearray(b"foobar"), b"foo"
463463
self.assertFalse(hmac.compare_digest(a, b))
464464
self.assertFalse(hmac.compare_digest(b, a))
@@ -472,7 +472,7 @@ def test_compare_digest(self):
472472
a, b = "foobar", "foobar"
473473
self.assertTrue(hmac.compare_digest(a, b))
474474

475-
# Testing str of diffeent lengths
475+
# Testing str of different lengths
476476
a, b = "foo", "foobar"
477477
self.assertFalse(hmac.compare_digest(a, b))
478478

Lib/test/test_importlib/source/test_file_loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def test_unchecked_hash_based_pyc(self):
325325
)
326326

327327
@util.writes_bytecode_files
328-
def test_overiden_unchecked_hash_based_pyc(self):
328+
def test_overridden_unchecked_hash_based_pyc(self):
329329
with util.create_modules('_temp') as mapping, \
330330
unittest.mock.patch('_imp.check_hash_based_pycs', 'always'):
331331
source = mapping['_temp']

Lib/test/test_importlib/test_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def test_new_style_classes(self):
3232
class ImportTests(fixtures.DistInfoPkg, unittest.TestCase):
3333
def test_import_nonexistent_module(self):
3434
# Ensure that the MetadataPathFinder does not crash an import of a
35-
# non-existant module.
35+
# non-existent module.
3636
with self.assertRaises(ImportError):
3737
importlib.import_module('does_not_exist')
3838

Lib/test/test_importlib/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ def contents(self):
443443
yield entry
444444

445445
name = 'testingpackage'
446-
# Unforunately importlib.util.module_from_spec() was not introduced until
446+
# Unfortunately importlib.util.module_from_spec() was not introduced until
447447
# Python 3.5.
448448
module = types.ModuleType(name)
449449
loader = Reader()

Lib/test/test_statistics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,13 +1810,13 @@ def test_bimodal_data(self):
18101810
# Test mode with bimodal data.
18111811
data = [1, 1, 2, 2, 2, 2, 3, 4, 5, 6, 6, 6, 6, 7, 8, 9, 9]
18121812
assert data.count(2) == data.count(6) == 4
1813-
# mode() should return 2, the first encounted mode
1813+
# mode() should return 2, the first encountered mode
18141814
self.assertEqual(self.func(data), 2)
18151815

18161816
def test_unique_data(self):
18171817
# Test mode when data points are all unique.
18181818
data = list(range(10))
1819-
# mode() should return 0, the first encounted mode
1819+
# mode() should return 0, the first encountered mode
18201820
self.assertEqual(self.func(data), 0)
18211821

18221822
def test_none_data(self):

Lib/test/test_tracemalloc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ def check_env_var_invalid(self, nframe):
885885
return
886886
if b'PYTHONTRACEMALLOC: invalid number of frames' in stderr:
887887
return
888-
self.fail(f"unexpeced output: {stderr!a}")
888+
self.fail(f"unexpected output: {stderr!a}")
889889

890890

891891
def test_env_var_invalid(self):
@@ -914,7 +914,7 @@ def check_sys_xoptions_invalid(self, nframe):
914914
return
915915
if b'-X tracemalloc=NFRAME: invalid number of frames' in stderr:
916916
return
917-
self.fail(f"unexpeced output: {stderr!a}")
917+
self.fail(f"unexpected output: {stderr!a}")
918918

919919
def test_sys_xoptions_invalid(self):
920920
for nframe in INVALID_NFRAME:

Lib/test/test_warnings/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ def test_showwarning_not_callable(self):
714714
self.assertRaises(TypeError, self.module.warn, "Warning!")
715715

716716
def test_show_warning_output(self):
717-
# With showarning() missing, make sure that output is okay.
717+
# With showwarning() missing, make sure that output is okay.
718718
text = 'test show_warning'
719719
with original_warnings.catch_warnings(module=self.module):
720720
self.module.filterwarnings("always", category=UserWarning)

Lib/test/test_winreg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def test_connect_registry_to_local_machine_works(self):
229229
h.Close()
230230
self.assertEqual(h.handle, 0)
231231

232-
def test_inexistant_remote_registry(self):
232+
def test_nonexistent_remote_registry(self):
233233
connect = lambda: ConnectRegistry("abcdefghijkl", HKEY_CURRENT_USER)
234234
self.assertRaises(OSError, connect)
235235

Lib/test/test_wsgiref.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,10 +586,10 @@ def testEnviron(self):
586586
expected.update({
587587
# X doesn't exist in os_environ
588588
"X": "Y",
589-
# HOME is overriden by TestHandler
589+
# HOME is overridden by TestHandler
590590
'HOME': "/override/home",
591591

592-
# overriden by setup_testing_defaults()
592+
# overridden by setup_testing_defaults()
593593
"SCRIPT_NAME": "",
594594
"SERVER_NAME": "127.0.0.1",
595595

Lib/tkinter/filedialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def test():
469469
except (ImportError, AttributeError):
470470
pass
471471

472-
# dialog for openening files
472+
# dialog for opening files
473473

474474
openfilename=askopenfilename(filetypes=[("all files", "*")])
475475
try:

Lib/unittest/test/testmock/testpatch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,7 +1651,7 @@ def test_patch_imports_lazily(self):
16511651
p1.stop()
16521652
self.assertEqual(squizz.squozz, 3)
16531653

1654-
def test_patch_propogrates_exc_on_exit(self):
1654+
def test_patch_propagates_exc_on_exit(self):
16551655
class holder:
16561656
exc_info = None, None, None
16571657

@@ -1680,9 +1680,9 @@ def test(mock):
16801680

16811681
self.assertIs(holder.exc_info[0], RuntimeError)
16821682
self.assertIsNotNone(holder.exc_info[1],
1683-
'exception value not propgated')
1683+
'exception value not propagated')
16841684
self.assertIsNotNone(holder.exc_info[2],
1685-
'exception traceback not propgated')
1685+
'exception traceback not propagated')
16861686

16871687

16881688
def test_create_and_specs(self):

Lib/uuid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ def _random_getnode():
680680
return random.getrandbits(48) | (1 << 40)
681681

682682

683-
# _OS_GETTERS, when known, are targetted for a specific OS or platform.
683+
# _OS_GETTERS, when known, are targeted for a specific OS or platform.
684684
# The order is by 'common practice' on the specified platform.
685685
# Note: 'posix' and 'windows' _OS_GETTERS are prefixed by a dll/dlload() method
686686
# which, when successful, means none of these "external" methods are called.

Misc/HISTORY

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ Library
12311231
- Issue #22448: Improve canceled timer handles cleanup to prevent
12321232
unbound memory usage. Patch by Joshua Moore-Oliva.
12331233

1234-
- Issue #23009: Make sure selectors.EpollSelecrtor.select() works when no
1234+
- Issue #23009: Make sure selectors.EpollSelector.select() works when no
12351235
FD is registered.
12361236

12371237
IDLE
@@ -16660,7 +16660,7 @@ Core and Builtins
1666016660
Exception (KeyboardInterrupt, and SystemExit) propagate instead of
1666116661
ignoring them.
1666216662

16663-
- #3021 Exception reraising sematics have been significantly improved. However,
16663+
- #3021 Exception reraising semantics have been significantly improved. However,
1666416664
f_exc_type, f_exc_value, and f_exc_traceback cannot be accessed from Python
1666516665
code anymore.
1666616666

Misc/NEWS.d/3.5.0a1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ Support wrapped callables in doctest. Patch by Claudiu Popa.
12551255
.. nonce: -sW7gk
12561256
.. section: Library
12571257
1258-
Make sure selectors.EpollSelecrtor.select() works when no FD is registered.
1258+
Make sure selectors.EpollSelector.select() works when no FD is registered.
12591259

12601260
..
12611261

Misc/NEWS.d/3.5.4rc1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ Fixed infinite recursion in the repr of uninitialized ctypes.CDLL instances.
913913
914914
Fixed race condition in C implementation of functools.lru_cache. KeyError
915915
could be raised when cached function with full cache was simultaneously
916-
called from differen threads with the same uncached arguments.
916+
called from different threads with the same uncached arguments.
917917

918918
..
919919

Misc/NEWS.d/3.6.0b1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ dict constraint in ForwardRef._eval_type (upstream #252)
11481148
.. nonce: hxh6_h
11491149
.. section: Library
11501150
1151-
Make ``_normalize`` parameter to ``Fraction`` constuctor keyword-only, so
1151+
Make ``_normalize`` parameter to ``Fraction`` constructor keyword-only, so
11521152
that ``Fraction(2, 3, 4)`` now raises ``TypeError``.
11531153

11541154
..

Misc/NEWS.d/3.6.0rc1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ they still are deprecated and will be disabled in 3.7.
4848
.. section: Library
4949
5050
Fix a regression introduced in warnings.catch_warnings(): call
51-
warnings.showwarning() if it was overriden inside the context manager.
51+
warnings.showwarning() if it was overridden inside the context manager.
5252

5353
..
5454

Misc/NEWS.d/3.6.1rc1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ Fix an important omission by adding Deque to the typing module.
435435
436436
Fixed race condition in C implementation of functools.lru_cache. KeyError
437437
could be raised when cached function with full cache was simultaneously
438-
called from differen threads with the same uncached arguments.
438+
called from different threads with the same uncached arguments.
439439

440440
..
441441

Misc/NEWS.d/3.7.0a1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3651,7 +3651,7 @@ regular expression objects.
36513651
36523652
Fixed race condition in C implementation of functools.lru_cache. KeyError
36533653
could be raised when cached function with full cache was simultaneously
3654-
called from differen threads with the same uncached arguments.
3654+
called from different threads with the same uncached arguments.
36553655

36563656
..
36573657

Misc/NEWS.d/3.8.0a1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2418,7 +2418,7 @@ over browsers in the ``BROWSER`` environment variable.
24182418
.. nonce: eSLKBE
24192419
.. section: Library
24202420
2421-
Avoid stripping trailing whitespace in doctest fancy diff. Orignial patch by
2421+
Avoid stripping trailing whitespace in doctest fancy diff. Original patch by
24222422
R. David Murray & Jairo Trad. Enhanced by Sanyam Khurana.
24232423

24242424
..

Misc/NEWS.d/3.8.0a4.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ Add ``-fmax-type-align=8`` to CFLAGS when clang compiler is detected. The
11101110
pymalloc memory allocator aligns memory on 8 bytes. On x86-64, clang expects
11111111
alignment on 16 bytes by default and so uses MOVAPS instruction which can
11121112
lead to segmentation fault. Instruct clang that Python is limited to
1113-
alignemnt on 8 bytes to use MOVUPS instruction instead: slower but don't
1113+
alignment on 8 bytes to use MOVUPS instruction instead: slower but don't
11141114
trigger a SIGSEGV if the memory is not aligned on 16 bytes. Sadly, the flag
11151115
must be added to ``CFLAGS`` and not just ``CFLAGS_NODIST``, since third
11161116
party C extensions can have the same issue.

Misc/NEWS.d/3.8.0b1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,7 @@ Reinitialize logging.Handler locks in forked child processes instead of
12621262
attempting to acquire them all in the parent before forking only to be
12631263
released in the child process. The acquire/release pattern was leading to
12641264
deadlocks in code that has implemented any form of chained logging handlers
1265-
that depend upon one another as the lock acquision order cannot be
1265+
that depend upon one another as the lock acquisition order cannot be
12661266
guaranteed.
12671267

12681268
..

Modules/_ctypes/callproc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static void pymem_destructor(PyObject *ptr)
110110
WinDLL(..., use_last_error=True) swap the system LastError value with the
111111
ctypes private copy.
112112
113-
The values are also swapped immeditately before and after ctypes callback
113+
The values are also swapped immediately before and after ctypes callback
114114
functions are called, if the callbacks are constructed using the new
115115
optional use_errno parameter set to True: CFUNCTYPE(..., use_errno=TRUE) or
116116
WINFUNCTYPE(..., use_errno=True).

Modules/_ctypes/stgdict.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
352352
int big_endian;
353353

354354
/* HACK Alert: I cannot be bothered to fix ctypes.com, so there has to
355-
be a way to use the old, broken sematics: _fields_ are not extended
355+
be a way to use the old, broken semantics: _fields_ are not extended
356356
but replaced in subclasses.
357357
358358
XXX Remove this in ctypes 1.0!

0 commit comments

Comments
 (0)
0