Skip to content

Commit c3d9508

Browse files
Leo Ariasterryjreedy
authored andcommitted
bpo-32746: Fix multiple typos (GH-5144)
Fix typos found by codespell in docs, docstrings, and comments.
1 parent 589c718 commit c3d9508

22 files changed

+34
-35
lines changed

Doc/library/optparse.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ An option group is obtained using the class :class:`OptionGroup`:
567567

568568
where
569569

570-
* parser is the :class:`OptionParser` instance the group will be insterted in
570+
* parser is the :class:`OptionParser` instance the group will be inserted in
571571
to
572572
* title is the group title
573573
* description, optional, is a long description of the group

Doc/library/ossaudiodev.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ the standard audio interface for Linux and recent versions of FreeBSD.
1414
.. Things will get more complicated for future Linux versions, since
1515
ALSA is in the standard kernel as of 2.5.x. Presumably if you
1616
use ALSA, you'll have to make sure its OSS compatibility layer
17-
is active to use ossaudiodev, but you're gonna need it for the vast
17+
is active to use ossaudiodev, but you're going to need it for the vast
1818
majority of Linux audio apps anyway.
1919
2020
Sounds like things are also complicated for other BSDs. In response
@@ -447,4 +447,3 @@ The remaining methods are specific to audio mixing:
447447
microphone input::
448448

449449
mixer.setrecsrc (1 << ossaudiodev.SOUND_MIXER_MIC)
450-

Lib/ctypes/_aix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
In documentation the archive is also referred to as the "base" and the shared
3333
library object is referred to as the "member".
3434
35-
For dlopen() on AIX (read initAndLoad()) the calls are similiar.
35+
For dlopen() on AIX (read initAndLoad()) the calls are similar.
3636
Default activity occurs when no path information is provided. When path
3737
information is provided dlopen() does not search any other directories.
3838
@@ -90,7 +90,7 @@ def get_ld_header_info(p):
9090
if re.match("[0-9]", line):
9191
info.append(line)
9292
else:
93-
# blank line (seperator), consume line and end for loop
93+
# blank line (separator), consume line and end for loop
9494
break
9595
return info
9696

Lib/email/_header_value_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2745,8 +2745,8 @@ def _fold_mime_parameters(part, lines, maxlen, encoding):
27452745
27462746
Using the decoded list of parameters and values, format them according to
27472747
the RFC rules, including using RFC2231 encoding if the value cannot be
2748-
expressed in 'encoding' and/or the paramter+value is too long to fit within
2749-
'maxlen'.
2748+
expressed in 'encoding' and/or the parameter+value is too long to fit
2749+
within 'maxlen'.
27502750
27512751
"""
27522752
# Special case for RFC2231 encoding: start from decoded values and use

Lib/idlelib/configdialog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def create_page_font_tab(self):
495495
Changing any of the font vars invokes var_changed_font, which
496496
adds all 3 font options to changes and calls set_samples.
497497
Set_samples applies a new font constructed from the font vars to
498-
font_sample and to highlight_sample on the hightlight page.
498+
font_sample and to highlight_sample on the highlight page.
499499
500500
Tabs: Enable users to change spaces entered for indent tabs.
501501
Changing indent_scale value with the mouse sets Var space_num,
@@ -646,7 +646,7 @@ def set_samples(self, event=None):
646646
647647
Called on font initialization and change events.
648648
Accesses font_name, font_size, and font_bold Variables.
649-
Updates font_sample and hightlight page highlight_sample.
649+
Updates font_sample and highlight page highlight_sample.
650650
"""
651651
font_name = self.font_name.get()
652652
font_weight = tkFont.BOLD if self.font_bold.get() else tkFont.NORMAL

Lib/opcode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def jabs_op(name, op):
142142
def_op('BUILD_TUPLE', 102) # Number of tuple items
143143
def_op('BUILD_LIST', 103) # Number of list items
144144
def_op('BUILD_SET', 104) # Number of set items
145-
def_op('BUILD_MAP', 105) # Number of dict entries (upto 255)
145+
def_op('BUILD_MAP', 105) # Number of dict entries
146146
name_op('LOAD_ATTR', 106) # Index in name list
147147
def_op('COMPARE_OP', 107) # Comparison operator
148148
hascompare.append(107)

Lib/test/datetimetester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1861,7 +1861,7 @@ def test_tz_independent_comparing(self):
18611861

18621862
# Make sure comparison doesn't forget microseconds, and isn't done
18631863
# via comparing a float timestamp (an IEEE double doesn't have enough
1864-
# precision to span microsecond resolution across years 1 thru 9999,
1864+
# precision to span microsecond resolution across years 1 through 9999,
18651865
# so comparing via timestamp necessarily calls some distinct values
18661866
# equal).
18671867
dt1 = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999998)

Lib/test/test_cmd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class samplecmdclass(cmd.Cmd):
5151
5252
Test for the function completedefault():
5353
>>> mycmd.completedefault()
54-
This is the completedefault methode
54+
This is the completedefault method
5555
>>> mycmd.completenames("a")
5656
['add']
5757
@@ -140,7 +140,7 @@ def postloop(self):
140140
print("Hello from postloop")
141141

142142
def completedefault(self, *ignored):
143-
print("This is the completedefault methode")
143+
print("This is the completedefault method")
144144

145145
def complete_command(self):
146146
print("complete command")

Lib/test/test_concurrent_futures.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def test_del_shutdown(self):
398398
queue_management_thread = executor._queue_management_thread
399399
del executor
400400

401-
# Make sure that all the executor ressources were properly cleaned by
401+
# Make sure that all the executor resources were properly cleaned by
402402
# the shutdown process
403403
queue_management_thread.join()
404404
for p in processes.values():
@@ -886,32 +886,32 @@ def test_crash(self):
886886
# extensive testing for deadlock caused by crashes in a pool.
887887
self.executor.shutdown(wait=True)
888888
crash_cases = [
889-
# Check problem occuring while pickling a task in
889+
# Check problem occurring while pickling a task in
890890
# the task_handler thread
891891
(id, (ErrorAtPickle(),), PicklingError, "error at task pickle"),
892-
# Check problem occuring while unpickling a task on workers
892+
# Check problem occurring while unpickling a task on workers
893893
(id, (ExitAtUnpickle(),), BrokenProcessPool,
894894
"exit at task unpickle"),
895895
(id, (ErrorAtUnpickle(),), BrokenProcessPool,
896896
"error at task unpickle"),
897897
(id, (CrashAtUnpickle(),), BrokenProcessPool,
898898
"crash at task unpickle"),
899-
# Check problem occuring during func execution on workers
899+
# Check problem occurring during func execution on workers
900900
(_crash, (), BrokenProcessPool,
901901
"crash during func execution on worker"),
902902
(_exit, (), SystemExit,
903903
"exit during func execution on worker"),
904904
(_raise_error, (RuntimeError, ), RuntimeError,
905905
"error during func execution on worker"),
906-
# Check problem occuring while pickling a task result
906+
# Check problem occurring while pickling a task result
907907
# on workers
908908
(_return_instance, (CrashAtPickle,), BrokenProcessPool,
909909
"crash during result pickle on worker"),
910910
(_return_instance, (ExitAtPickle,), SystemExit,
911911
"exit during result pickle on worker"),
912912
(_return_instance, (ErrorAtPickle,), PicklingError,
913913
"error during result pickle on worker"),
914-
# Check problem occuring while unpickling a task in
914+
# Check problem occurring while unpickling a task in
915915
# the result_handler thread
916916
(_return_instance, (ErrorAtUnpickle,), BrokenProcessPool,
917917
"error during result unpickle in result_handler"),

Lib/test/test_generators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ def second():
15001500
succs[final].remove(corner)
15011501
add_to_successors(this)
15021502

1503-
# Generate moves 3 thru m*n-1.
1503+
# Generate moves 3 through m*n-1.
15041504
def advance(len=len):
15051505
# If some successor has only one exit, must take it.
15061506
# Else favor successors with fewer exits.
@@ -1522,7 +1522,7 @@ def advance(len=len):
15221522
yield i
15231523
add_to_successors(i)
15241524

1525-
# Generate moves 3 thru m*n-1. Alternative version using a
1525+
# Generate moves 3 through m*n-1. Alternative version using a
15261526
# stronger (but more expensive) heuristic to order successors.
15271527
# Since the # of backtracking levels is m*n, a poor move early on
15281528
# can take eons to undo. Smallest square board for which this

Lib/test/test_weakref.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,7 @@ def __eq__(self, other):
16371637
# has to keep looping to find the first object we delete.
16381638
objs.reverse()
16391639

1640-
# Turn on mutation in C.__eq__. The first time thru the loop,
1640+
# Turn on mutation in C.__eq__. The first time through the loop,
16411641
# under the iterkeys() business the first comparison will delete
16421642
# the last item iterkeys() would see, and that causes a
16431643
# RuntimeError: dictionary changed size during iteration

Lib/unittest/test/test_discovery.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ def loadTestsFromModule(module, pattern=None):
199199
['a_directory', 'test_directory', 'test_directory2'])
200200

201201
# load_tests should have been called once with loader, tests and pattern
202-
# (but there are no tests in our stub module itself, so thats [] at the
203-
# time of call.
202+
# (but there are no tests in our stub module itself, so that is [] at
203+
# the time of call).
204204
self.assertEqual(Module.load_tests_args,
205205
[(loader, [], 'test*')])
206206

Modules/_asynciomodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ is_coroutine(PyObject *coro)
187187
return _is_coroutine(coro);
188188
}
189189

190-
/* either an error has occured or
190+
/* either an error has occurred or
191191
type(coro) is in iscoroutine_typecache
192192
*/
193193
return has_it;

Modules/_datetimemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3420,7 +3420,7 @@ tzinfo_fromutc(PyDateTime_TZInfo *self, PyObject *dt)
34203420
PyErr_SetString(PyExc_ValueError, "fromutc: tz.dst() gave"
34213421
"inconsistent results; cannot convert");
34223422

3423-
/* fall thru to failure */
3423+
/* fall through to failure */
34243424
Fail:
34253425
Py_XDECREF(off);
34263426
Py_XDECREF(dst);

Modules/_hashopenssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ generate_hash_name_list(void)
962962
* This macro generates constructor function definitions for specific
963963
* hash algorithms. These constructors are much faster than calling
964964
* the generic one passing it a python string and are noticeably
965-
* faster than calling a python new() wrapper. Thats important for
965+
* faster than calling a python new() wrapper. That is important for
966966
* code that wants to make hashes of a bunch of small strings.
967967
* The first call will lazy-initialize, which reports an exception
968968
* if initialization fails.

Modules/_pickle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ _Pickler_OpcodeBoundary(PicklerObject *self)
10151015
if(_Pickler_CommitFrame(self)) {
10161016
return -1;
10171017
}
1018-
/* Flush the content of the commited frame to the underlying
1018+
/* Flush the content of the committed frame to the underlying
10191019
* file and reuse the pickler buffer for the next frame so as
10201020
* to limit memory usage when dumping large complex objects to
10211021
* a file.

Modules/md5module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ md5_done(struct md5_state *md5, unsigned char *out)
293293
md5->curlen = 0;
294294
}
295295

296-
/* pad upto 56 bytes of zeroes */
296+
/* pad up to 56 bytes of zeroes */
297297
while (md5->curlen < 56) {
298298
md5->buf[md5->curlen++] = (unsigned char)0;
299299
}

Modules/socketmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6156,7 +6156,7 @@ socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs)
61566156
}
61576157
#if defined(__APPLE__) && defined(AI_NUMERICSERV)
61586158
if ((flags & AI_NUMERICSERV) && (pptr == NULL || (pptr[0] == '0' && pptr[1] == 0))) {
6159-
/* On OSX upto at least OSX 10.8 getaddrinfo crashes
6159+
/* On OSX up to at least OSX 10.8 getaddrinfo crashes
61606160
* if AI_NUMERICSERV is set and the servname is NULL or "0".
61616161
* This workaround avoids a segfault in libsystem.
61626162
*/

Objects/obmalloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2469,7 +2469,7 @@ pool_is_in_list(const poolp target, poolp list)
24692469
* checks.
24702470
*
24712471
* Return 0 if the memory debug hooks are not installed or no statistics was
2472-
* writen into out, return 1 otherwise.
2472+
* written into out, return 1 otherwise.
24732473
*/
24742474
int
24752475
_PyObject_DebugMallocStats(FILE *out)

Objects/tupleobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ tuplerepr(PyTupleObject *v)
335335

336336
/* The addend 82520, was selected from the range(0, 1000000) for
337337
generating the greatest number of prime multipliers for tuples
338-
upto length eight:
338+
up to length eight:
339339
340340
1082527, 1165049, 1082531, 1165057, 1247581, 1330103, 1082533,
341341
1330111, 1412633, 1165069, 1247599, 1495177, 1577699

Objects/typeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5112,7 +5112,7 @@ PyType_Ready(PyTypeObject *type)
51125112
/* PyType_Ready is the closest thing we have to a choke point
51135113
* for type objects, so is the best place I can think of to try
51145114
* to get type objects into the doubly-linked list of all objects.
5115-
* Still, not all type objects go thru PyType_Ready.
5115+
* Still, not all type objects go through PyType_Ready.
51165116
*/
51175117
_Py_AddToAllObjects((PyObject *)type, 0);
51185118
#endif

Python/getargs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,7 +1784,7 @@ vgetargskeywords(PyObject *args, PyObject *kwargs, const char *format,
17841784
}
17851785
}
17861786

1787-
/* We are into optional args, skip thru to any remaining
1787+
/* We are into optional args, skip through to any remaining
17881788
* keyword args */
17891789
msg = skipitem(&format, p_va, flags);
17901790
if (msg) {
@@ -2176,7 +2176,7 @@ vgetargskeywordsfast_impl(PyObject *const *args, Py_ssize_t nargs,
21762176
return cleanreturn(1, &freelist);
21772177
}
21782178

2179-
/* We are into optional args, skip thru to any remaining
2179+
/* We are into optional args, skip through to any remaining
21802180
* keyword args */
21812181
msg = skipitem(&format, p_va, flags);
21822182
assert(msg == NULL);

0 commit comments

Comments
 (0)