From 65d09e6fddbd5032ac35eed957ea3873c47867f7 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 6 Oct 2021 16:38:20 +0200 Subject: [PATCH 1/2] Fix typos in the Modules directory --- Modules/_csv.c | 2 +- Modules/_ctypes/callproc.c | 2 +- Modules/_ctypes/cfield.c | 2 +- Modules/_ctypes/ctypes.h | 2 +- Modules/_ctypes/libffi_osx/include/ffi.h | 2 +- Modules/_ctypes/libffi_osx/powerpc/ppc-ffi_darwin.c | 2 +- Modules/_ctypes/libffi_osx/x86/x86-ffi64.c | 2 +- Modules/_pickle.c | 4 ++-- Modules/_sre.c | 2 +- Modules/_testcapimodule.c | 4 ++-- Modules/_threadmodule.c | 2 +- Modules/_tkinter.c | 2 +- Modules/_tracemalloc.c | 2 +- Modules/_zoneinfo.c | 2 +- Modules/expat/xmlparse.c | 2 +- Modules/gc_weakref.txt | 2 +- Modules/getpath.c | 2 +- Modules/sha1module.c | 2 +- Modules/signalmodule.c | 2 +- Modules/socketmodule.c | 2 +- Modules/syslogmodule.c | 2 +- Modules/zlibmodule.c | 2 +- 22 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Modules/_csv.c b/Modules/_csv.c index 3109fd16bc744b..3729d2be362522 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -489,7 +489,7 @@ dialect_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) } /* Since dialect is now a heap type, it inherits pickling method for - * protocol 0 and 1 from object, therefore it needs to be overriden */ + * protocol 0 and 1 from object, therefore it needs to be overridden */ PyDoc_STRVAR(dialect_reduce_doc, "raises an exception to avoid pickling"); diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index 17e82f90cf4740..e2204961070dbf 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -834,7 +834,7 @@ static int _call_function_pointer(int flags, # define HAVE_FFI_PREP_CIF_VAR_RUNTIME false # endif - /* Even on Apple-arm64 the calling convention for variadic functions conincides + /* Even on Apple-arm64 the calling convention for variadic functions coincides * with the standard calling convention in the case that the function called * only with its fixed arguments. Thus, we do not need a special flag to be * set on variadic functions. We treat a function as variadic if it is called diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c index a21a9daaed02cc..ec6feca8b0f809 100644 --- a/Modules/_ctypes/cfield.c +++ b/Modules/_ctypes/cfield.c @@ -35,7 +35,7 @@ PyCField_new(PyTypeObject *type, PyObject *args, PyObject *kwds) * Expects the size, index and offset for the current field in *psize and * *poffset, stores the total size so far in *psize, the offset for the next * field in *poffset, the alignment requirements for the current field in - * *palign, and returns a field desriptor for this field. + * *palign, and returns a field descriptor for this field. */ /* * bitfields extension: diff --git a/Modules/_ctypes/ctypes.h b/Modules/_ctypes/ctypes.h index 6110027980827c..9600ddc7413b2e 100644 --- a/Modules/_ctypes/ctypes.h +++ b/Modules/_ctypes/ctypes.h @@ -208,7 +208,7 @@ typedef struct { PyObject *checker; int flags; /* calling convention and such */ - /* pep3118 fields, pointers neeed PyMem_Free */ + /* pep3118 fields, pointers need PyMem_Free */ char *format; int ndim; Py_ssize_t *shape; diff --git a/Modules/_ctypes/libffi_osx/include/ffi.h b/Modules/_ctypes/libffi_osx/include/ffi.h index c104a5c89350b6..3f8bf4764072e7 100644 --- a/Modules/_ctypes/libffi_osx/include/ffi.h +++ b/Modules/_ctypes/libffi_osx/include/ffi.h @@ -274,7 +274,7 @@ typedef struct ffi_raw_closure { #if !FFI_NATIVE_RAW_API /* if this is enabled, then a raw closure has the same layout as a regular closure. We use this to install an intermediate - handler to do the transaltion, void** -> ffi_raw*. */ + handler to do the translation, void** -> ffi_raw*. */ void (*translate_args)(ffi_cif*,void*,void**,void*); void* this_closure; #endif diff --git a/Modules/_ctypes/libffi_osx/powerpc/ppc-ffi_darwin.c b/Modules/_ctypes/libffi_osx/powerpc/ppc-ffi_darwin.c index 8953d5fda35818..dba2184099a255 100644 --- a/Modules/_ctypes/libffi_osx/powerpc/ppc-ffi_darwin.c +++ b/Modules/_ctypes/libffi_osx/powerpc/ppc-ffi_darwin.c @@ -650,7 +650,7 @@ ffi_call( +---------------------------------------+ 160 | result area 8 | +---------------------------------------+ 168 - | alignement to the next multiple of 16 | + | alignment to the next multiple of 16 | SP current --> +---------------------------------------+ 176 <- parent frame | back chain to caller 4 | +---------------------------------------+ 180 diff --git a/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c b/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c index 8e7d016488029f..2268a31aab10ba 100644 --- a/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c +++ b/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c @@ -55,7 +55,7 @@ ffi_call_unix64( /* Register class used for passing given 64bit part of the argument. These represent classes as documented by the PS ABI, with the exception of SSESF, SSEDF classes, that are basically SSE class, just gcc will - use SF or DFmode move instead of DImode to avoid reformating penalties. + use SF or DFmode move instead of DImode to avoid reformatting penalties. Similarly we play games with INTEGERSI_CLASS to use cheaper SImode moves whenever possible (upper half does contain padding). */ diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 3e74fafb384176..e693b506a1e91f 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -4527,7 +4527,7 @@ dump(PicklerObject *self, PyObject *obj) * call when setting the reducer_override attribute of the Pickler instance * to a bound method of the same instance. This is important as the Pickler * instance holds a reference to each object it has pickled (through its - * memo): thus, these objects wont be garbage-collected as long as the + * memo): thus, these objects won't be garbage-collected as long as the * Pickler itself is not collected. */ Py_CLEAR(self->reducer_override); return status; @@ -6540,7 +6540,7 @@ do_setitems(UnpicklerObject *self, Py_ssize_t x) return 0; if ((len - x) % 2 != 0) { PickleState *st = _Pickle_GetGlobalState(); - /* Currupt or hostile pickle -- we never write one like this. */ + /* Corrupt or hostile pickle -- we never write one like this. */ PyErr_SetString(st->UnpicklingError, "odd number of items for SETITEMS"); return -1; diff --git a/Modules/_sre.c b/Modules/_sre.c index f4ec862dcabf0d..213730860cfb53 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -15,7 +15,7 @@ * 2001-05-14 fl fixes for 1.5.2 compatibility * 2001-07-01 fl added BIGCHARSET support (from Martin von Loewis) * 2001-10-18 fl fixed group reset issue (from Matthew Mueller) - * 2001-10-20 fl added split primitive; reenable unicode for 1.6/2.0/2.1 + * 2001-10-20 fl added split primitive; re-enable unicode for 1.6/2.0/2.1 * 2001-10-21 fl added sub/subn primitive * 2001-10-24 fl added finditer primitive (for 2.2 only) * 2001-12-07 fl fixed memory leak in sub/subn (Guido van Rossum) diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 03dc7763bfd051..4a2907f3f06bd5 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -5323,7 +5323,7 @@ encode_locale_ex(PyObject *self, PyObject *args) PyErr_SetString(PyExc_ValueError, "unsupported error handler"); break; default: - PyErr_SetString(PyExc_ValueError, "unknow error code"); + PyErr_SetString(PyExc_ValueError, "unknown error code"); break; } return res; @@ -5366,7 +5366,7 @@ decode_locale_ex(PyObject *self, PyObject *args) PyErr_SetString(PyExc_ValueError, "unsupported error handler"); break; default: - PyErr_SetString(PyExc_ValueError, "unknow error code"); + PyErr_SetString(PyExc_ValueError, "unknown error code"); break; } return res; diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index 543d82d0b93824..ff858386b426ff 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -1219,7 +1219,7 @@ where the corresponding signal handler will be executed.\n\ If *signum* is omitted, SIGINT is assumed.\n\ A subthread can use this function to interrupt the main thread.\n\ \n\ -Note: the default signal hander for SIGINT raises ``KeyboardInterrupt``." +Note: the default signal handler for SIGINT raises ``KeyboardInterrupt``." ); static lockobject *newlockobject(PyObject *module); diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 7be9b8c0385b97..aabf20b8d963c7 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -797,7 +797,7 @@ PyTclObject_str(PyTclObject *self) Py_INCREF(self->string); return self->string; } - /* XXX Could chache result if it is non-ASCII. */ + /* XXX Could cache result if it is non-ASCII. */ return unicodeFromTclObj(self->value); } diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index 09d18fb8f278f0..9ba0ebbbaab5c5 100644 --- a/Modules/_tracemalloc.c +++ b/Modules/_tracemalloc.c @@ -833,7 +833,7 @@ tracemalloc_clear_filename(void *value) static void tracemalloc_clear_traces(void) { - /* The GIL protects variables againt concurrent access */ + /* The GIL protects variables against concurrent access */ assert(PyGILState_Check()); TABLES_LOCK(); diff --git a/Modules/_zoneinfo.c b/Modules/_zoneinfo.c index c722330ee491a9..04fa09422b2134 100644 --- a/Modules/_zoneinfo.c +++ b/Modules/_zoneinfo.c @@ -1342,7 +1342,7 @@ tzrule_transitions(_tzrule *rule, int year, int64_t *start, int64_t *end) * could technically be calculated from the timestamp, but given that the * callers of this function already have the year information accessible from * the datetime struct, it is taken as an additional parameter to reduce - * unncessary calculation. + * unnecessary calculation. * */ static _ttinfo * find_tzrule_ttinfo(_tzrule *rule, int64_t ts, unsigned char fold, int year) diff --git a/Modules/expat/xmlparse.c b/Modules/expat/xmlparse.c index 5ba56eaea6357a..034a03c30851a1 100644 --- a/Modules/expat/xmlparse.c +++ b/Modules/expat/xmlparse.c @@ -3976,7 +3976,7 @@ initializeEncoding(XML_Parser parser) { const char *s; #ifdef XML_UNICODE char encodingBuf[128]; - /* See comments abount `protoclEncodingName` in parserInit() */ + /* See comments about `protoclEncodingName` in parserInit() */ if (! parser->m_protocolEncodingName) s = NULL; else { diff --git a/Modules/gc_weakref.txt b/Modules/gc_weakref.txt index b5b9f7b2e3d4dc..6d07cce1236431 100644 --- a/Modules/gc_weakref.txt +++ b/Modules/gc_weakref.txt @@ -50,7 +50,7 @@ CT while gc is running. https://www.python.org/sf/1055820 shows how innocent it can be, and also how nasty. Variants of the three -focussed test cases attached to that bug report are now part of Python's +focused test cases attached to that bug report are now part of Python's standard Lib/test/test_gc.py. Jim Fulton gave the best nutshell summary of the new (in 2.4 and 2.3.5) diff --git a/Modules/getpath.c b/Modules/getpath.c index 56775e9cb44af0..22e5ef24b5d578 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -1457,7 +1457,7 @@ calculate_path(PyCalculatePath *calculate, _PyPathConfig *pathconfig) } /* If a pyvenv.cfg configure file is found, - argv0_path is overriden with its 'home' variable. */ + argv0_path is overridden with its 'home' variable. */ status = calculate_read_pyenv(calculate); if (_PyStatus_EXCEPTION(status)) { return status; diff --git a/Modules/sha1module.c b/Modules/sha1module.c index 6980051dc08f8a..d186aa460a07b1 100644 --- a/Modules/sha1module.c +++ b/Modules/sha1module.c @@ -269,7 +269,7 @@ sha1_done(struct sha1_state *sha1, unsigned char *out) sha1->curlen = 0; } - /* pad upto 56 bytes of zeroes */ + /* pad up to 56 bytes of zeroes */ while (sha1->curlen < 56) { sha1->buf[sha1->curlen++] = (unsigned char)0; } diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index 8b7ef2cc688fea..d5e6a43af28653 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -1595,7 +1595,7 @@ signal_get_set_handlers(signal_state_t *state, PyObject *mod_dict) Py_XDECREF(old_func); } - // Instal Python SIGINT handler which raises KeyboardInterrupt + // Install Python SIGINT handler which raises KeyboardInterrupt PyObject* sigint_func = get_handler(SIGINT); if (sigint_func == state->default_handler) { PyObject *int_handler = PyMapping_GetItemString(mod_dict, diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 98212274b46a9e..50962c41cd3a68 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -929,7 +929,7 @@ sock_call_ex(PySocketSockObject *s, reading, but the data then discarded by the OS because of a wrong checksum. - Loop on select() to recheck for socket readyness. */ + Loop on select() to recheck for socket readiness. */ continue; } diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c index cdc94a60a373d7..0f2fea15b3a6f0 100644 --- a/Modules/syslogmodule.c +++ b/Modules/syslogmodule.c @@ -183,7 +183,7 @@ syslog_syslog(PyObject * self, PyObject * args) PyObject *openargs; /* Continue even if PyTuple_New fails, because openlog(3) is optional. - * So, we can still do loggin in the unlikely event things are so hosed + * So, we can still do logging in the unlikely event things are so hosed * that we can't do this tuple. */ if ((openargs = PyTuple_New(0))) { diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c index 28fe8840fc0675..67bde701fa608b 100644 --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -82,7 +82,7 @@ typedef struct { Bytef *next_posi; } _Uint32Window; -/* Initialize the buffer with an inital buffer size. +/* Initialize the buffer with an initial buffer size. On success, return value >= 0 On failure, return value < 0 */ From 226060847ddef646afe8572f79a863ffd103be24 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 7 Oct 2021 10:10:38 +0200 Subject: [PATCH 2/2] fixup! Revert all changes to libffi_osx --- Modules/_ctypes/libffi_osx/include/ffi.h | 2 +- Modules/_ctypes/libffi_osx/powerpc/ppc-ffi_darwin.c | 2 +- Modules/_ctypes/libffi_osx/x86/x86-ffi64.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/_ctypes/libffi_osx/include/ffi.h b/Modules/_ctypes/libffi_osx/include/ffi.h index 3f8bf4764072e7..c104a5c89350b6 100644 --- a/Modules/_ctypes/libffi_osx/include/ffi.h +++ b/Modules/_ctypes/libffi_osx/include/ffi.h @@ -274,7 +274,7 @@ typedef struct ffi_raw_closure { #if !FFI_NATIVE_RAW_API /* if this is enabled, then a raw closure has the same layout as a regular closure. We use this to install an intermediate - handler to do the translation, void** -> ffi_raw*. */ + handler to do the transaltion, void** -> ffi_raw*. */ void (*translate_args)(ffi_cif*,void*,void**,void*); void* this_closure; #endif diff --git a/Modules/_ctypes/libffi_osx/powerpc/ppc-ffi_darwin.c b/Modules/_ctypes/libffi_osx/powerpc/ppc-ffi_darwin.c index dba2184099a255..8953d5fda35818 100644 --- a/Modules/_ctypes/libffi_osx/powerpc/ppc-ffi_darwin.c +++ b/Modules/_ctypes/libffi_osx/powerpc/ppc-ffi_darwin.c @@ -650,7 +650,7 @@ ffi_call( +---------------------------------------+ 160 | result area 8 | +---------------------------------------+ 168 - | alignment to the next multiple of 16 | + | alignement to the next multiple of 16 | SP current --> +---------------------------------------+ 176 <- parent frame | back chain to caller 4 | +---------------------------------------+ 180 diff --git a/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c b/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c index 2268a31aab10ba..8e7d016488029f 100644 --- a/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c +++ b/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c @@ -55,7 +55,7 @@ ffi_call_unix64( /* Register class used for passing given 64bit part of the argument. These represent classes as documented by the PS ABI, with the exception of SSESF, SSEDF classes, that are basically SSE class, just gcc will - use SF or DFmode move instead of DImode to avoid reformatting penalties. + use SF or DFmode move instead of DImode to avoid reformating penalties. Similarly we play games with INTEGERSI_CLASS to use cheaper SImode moves whenever possible (upper half does contain padding). */