Skip to content

Commit dd02a69

Browse files
authored
Fix typos in the Modules directory (GH-28761)
1 parent 5baec4a commit dd02a69

19 files changed

+21
-21
lines changed

Modules/_csv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ dialect_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
489489
}
490490

491491
/* Since dialect is now a heap type, it inherits pickling method for
492-
* protocol 0 and 1 from object, therefore it needs to be overriden */
492+
* protocol 0 and 1 from object, therefore it needs to be overridden */
493493

494494
PyDoc_STRVAR(dialect_reduce_doc, "raises an exception to avoid pickling");
495495

Modules/_ctypes/callproc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ static int _call_function_pointer(int flags,
834834
# define HAVE_FFI_PREP_CIF_VAR_RUNTIME false
835835
# endif
836836

837-
/* Even on Apple-arm64 the calling convention for variadic functions conincides
837+
/* Even on Apple-arm64 the calling convention for variadic functions coincides
838838
* with the standard calling convention in the case that the function called
839839
* only with its fixed arguments. Thus, we do not need a special flag to be
840840
* set on variadic functions. We treat a function as variadic if it is called

Modules/_ctypes/cfield.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ PyCField_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
3535
* Expects the size, index and offset for the current field in *psize and
3636
* *poffset, stores the total size so far in *psize, the offset for the next
3737
* field in *poffset, the alignment requirements for the current field in
38-
* *palign, and returns a field desriptor for this field.
38+
* *palign, and returns a field descriptor for this field.
3939
*/
4040
/*
4141
* bitfields extension:

Modules/_ctypes/ctypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ typedef struct {
208208
PyObject *checker;
209209
int flags; /* calling convention and such */
210210

211-
/* pep3118 fields, pointers neeed PyMem_Free */
211+
/* pep3118 fields, pointers need PyMem_Free */
212212
char *format;
213213
int ndim;
214214
Py_ssize_t *shape;

Modules/_pickle.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4527,7 +4527,7 @@ dump(PicklerObject *self, PyObject *obj)
45274527
* call when setting the reducer_override attribute of the Pickler instance
45284528
* to a bound method of the same instance. This is important as the Pickler
45294529
* instance holds a reference to each object it has pickled (through its
4530-
* memo): thus, these objects wont be garbage-collected as long as the
4530+
* memo): thus, these objects won't be garbage-collected as long as the
45314531
* Pickler itself is not collected. */
45324532
Py_CLEAR(self->reducer_override);
45334533
return status;
@@ -6540,7 +6540,7 @@ do_setitems(UnpicklerObject *self, Py_ssize_t x)
65406540
return 0;
65416541
if ((len - x) % 2 != 0) {
65426542
PickleState *st = _Pickle_GetGlobalState();
6543-
/* Currupt or hostile pickle -- we never write one like this. */
6543+
/* Corrupt or hostile pickle -- we never write one like this. */
65446544
PyErr_SetString(st->UnpicklingError,
65456545
"odd number of items for SETITEMS");
65466546
return -1;

Modules/_sre.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* 2001-05-14 fl fixes for 1.5.2 compatibility
1616
* 2001-07-01 fl added BIGCHARSET support (from Martin von Loewis)
1717
* 2001-10-18 fl fixed group reset issue (from Matthew Mueller)
18-
* 2001-10-20 fl added split primitive; reenable unicode for 1.6/2.0/2.1
18+
* 2001-10-20 fl added split primitive; re-enable unicode for 1.6/2.0/2.1
1919
* 2001-10-21 fl added sub/subn primitive
2020
* 2001-10-24 fl added finditer primitive (for 2.2 only)
2121
* 2001-12-07 fl fixed memory leak in sub/subn (Guido van Rossum)

Modules/_testcapimodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5323,7 +5323,7 @@ encode_locale_ex(PyObject *self, PyObject *args)
53235323
PyErr_SetString(PyExc_ValueError, "unsupported error handler");
53245324
break;
53255325
default:
5326-
PyErr_SetString(PyExc_ValueError, "unknow error code");
5326+
PyErr_SetString(PyExc_ValueError, "unknown error code");
53275327
break;
53285328
}
53295329
return res;
@@ -5366,7 +5366,7 @@ decode_locale_ex(PyObject *self, PyObject *args)
53665366
PyErr_SetString(PyExc_ValueError, "unsupported error handler");
53675367
break;
53685368
default:
5369-
PyErr_SetString(PyExc_ValueError, "unknow error code");
5369+
PyErr_SetString(PyExc_ValueError, "unknown error code");
53705370
break;
53715371
}
53725372
return res;

Modules/_threadmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ where the corresponding signal handler will be executed.\n\
12191219
If *signum* is omitted, SIGINT is assumed.\n\
12201220
A subthread can use this function to interrupt the main thread.\n\
12211221
\n\
1222-
Note: the default signal hander for SIGINT raises ``KeyboardInterrupt``."
1222+
Note: the default signal handler for SIGINT raises ``KeyboardInterrupt``."
12231223
);
12241224

12251225
static lockobject *newlockobject(PyObject *module);

Modules/_tkinter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ PyTclObject_str(PyTclObject *self)
797797
Py_INCREF(self->string);
798798
return self->string;
799799
}
800-
/* XXX Could chache result if it is non-ASCII. */
800+
/* XXX Could cache result if it is non-ASCII. */
801801
return unicodeFromTclObj(self->value);
802802
}
803803

Modules/_tracemalloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ tracemalloc_clear_filename(void *value)
833833
static void
834834
tracemalloc_clear_traces(void)
835835
{
836-
/* The GIL protects variables againt concurrent access */
836+
/* The GIL protects variables against concurrent access */
837837
assert(PyGILState_Check());
838838

839839
TABLES_LOCK();

Modules/_zoneinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ tzrule_transitions(_tzrule *rule, int year, int64_t *start, int64_t *end)
13421342
* could technically be calculated from the timestamp, but given that the
13431343
* callers of this function already have the year information accessible from
13441344
* the datetime struct, it is taken as an additional parameter to reduce
1345-
* unncessary calculation.
1345+
* unnecessary calculation.
13461346
* */
13471347
static _ttinfo *
13481348
find_tzrule_ttinfo(_tzrule *rule, int64_t ts, unsigned char fold, int year)

Modules/expat/xmlparse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3976,7 +3976,7 @@ initializeEncoding(XML_Parser parser) {
39763976
const char *s;
39773977
#ifdef XML_UNICODE
39783978
char encodingBuf[128];
3979-
/* See comments abount `protoclEncodingName` in parserInit() */
3979+
/* See comments about `protoclEncodingName` in parserInit() */
39803980
if (! parser->m_protocolEncodingName)
39813981
s = NULL;
39823982
else {

Modules/gc_weakref.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ CT while gc is running.
5050
https://www.python.org/sf/1055820
5151

5252
shows how innocent it can be, and also how nasty. Variants of the three
53-
focussed test cases attached to that bug report are now part of Python's
53+
focused test cases attached to that bug report are now part of Python's
5454
standard Lib/test/test_gc.py.
5555

5656
Jim Fulton gave the best nutshell summary of the new (in 2.4 and 2.3.5)

Modules/getpath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,7 +1457,7 @@ calculate_path(PyCalculatePath *calculate, _PyPathConfig *pathconfig)
14571457
}
14581458

14591459
/* If a pyvenv.cfg configure file is found,
1460-
argv0_path is overriden with its 'home' variable. */
1460+
argv0_path is overridden with its 'home' variable. */
14611461
status = calculate_read_pyenv(calculate);
14621462
if (_PyStatus_EXCEPTION(status)) {
14631463
return status;

Modules/sha1module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ sha1_done(struct sha1_state *sha1, unsigned char *out)
269269
sha1->curlen = 0;
270270
}
271271

272-
/* pad upto 56 bytes of zeroes */
272+
/* pad up to 56 bytes of zeroes */
273273
while (sha1->curlen < 56) {
274274
sha1->buf[sha1->curlen++] = (unsigned char)0;
275275
}

Modules/signalmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1595,7 +1595,7 @@ signal_get_set_handlers(signal_state_t *state, PyObject *mod_dict)
15951595
Py_XDECREF(old_func);
15961596
}
15971597

1598-
// Instal Python SIGINT handler which raises KeyboardInterrupt
1598+
// Install Python SIGINT handler which raises KeyboardInterrupt
15991599
PyObject* sigint_func = get_handler(SIGINT);
16001600
if (sigint_func == state->default_handler) {
16011601
PyObject *int_handler = PyMapping_GetItemString(mod_dict,

Modules/socketmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ sock_call_ex(PySocketSockObject *s,
929929
reading, but the data then discarded by the OS because of a
930930
wrong checksum.
931931
932-
Loop on select() to recheck for socket readyness. */
932+
Loop on select() to recheck for socket readiness. */
933933
continue;
934934
}
935935

Modules/syslogmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ syslog_syslog(PyObject * self, PyObject * args)
183183
PyObject *openargs;
184184

185185
/* Continue even if PyTuple_New fails, because openlog(3) is optional.
186-
* So, we can still do loggin in the unlikely event things are so hosed
186+
* So, we can still do logging in the unlikely event things are so hosed
187187
* that we can't do this tuple.
188188
*/
189189
if ((openargs = PyTuple_New(0))) {

Modules/zlibmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ typedef struct {
8282
Bytef *next_posi;
8383
} _Uint32Window;
8484

85-
/* Initialize the buffer with an inital buffer size.
85+
/* Initialize the buffer with an initial buffer size.
8686
8787
On success, return value >= 0
8888
On failure, return value < 0 */

0 commit comments

Comments
 (0)