Issue #27895:  Spelling fixes (Contributed by Ville Skyttä).
diff --git a/Modules/_ctypes/ctypes.h b/Modules/_ctypes/ctypes.h
index b06ba8a..b4a9b78 100644
--- a/Modules/_ctypes/ctypes.h
+++ b/Modules/_ctypes/ctypes.h
@@ -238,7 +238,7 @@
  StgDictObject function to a generic one.
 
  Currently, PyCFuncPtr types have 'converters' and 'checker' entries in their
- type dict.  They are only used to cache attributes from other entries, whihc
+ type dict.  They are only used to cache attributes from other entries, which
  is wrong.
 
  One use case is the .value attribute that all simple types have.  But some
diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
index 44765ac..f45744a 100644
--- a/Modules/_hashopenssl.c
+++ b/Modules/_hashopenssl.c
@@ -724,7 +724,7 @@
 /*
  *  This macro generates constructor function definitions for specific
  *  hash algorithms.  These constructors are much faster than calling
- *  the generic one passing it a python string and are noticably
+ *  the generic one passing it a python string and are noticeably
  *  faster than calling a python new() wrapper.  Thats important for
  *  code that wants to make hashes of a bunch of small strings.
  */
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c
index f07a0ca..472ef3b 100644
--- a/Modules/_io/iobase.c
+++ b/Modules/_io/iobase.c
@@ -90,7 +90,7 @@
     return NULL;
 }
 
-/* Positionning */
+/* Positioning */
 
 PyDoc_STRVAR(iobase_seek_doc,
     "Change stream position.\n"
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index f029ed6..a8d414e 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -2131,7 +2131,7 @@
         Py_UCS4 ch = PyUnicode_READ(kind, data, i);
         /* Map 32-bit characters to '\Uxxxxxxxx' */
         if (ch >= 0x10000) {
-            /* -1: substract 1 preallocated byte */
+            /* -1: subtract 1 preallocated byte */
             p = _PyBytesWriter_Prepare(&writer, p, 10-1);
             if (p == NULL)
                 goto error;
@@ -2149,7 +2149,7 @@
         }
         /* Map 16-bit characters, '\\' and '\n' to '\uxxxx' */
         else if (ch >= 256 || ch == '\\' || ch == '\n') {
-            /* -1: substract 1 preallocated byte */
+            /* -1: subtract 1 preallocated byte */
             p = _PyBytesWriter_Prepare(&writer, p, 6-1);
             if (p == NULL)
                 goto error;
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 5d661f7..6fabc40 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -3798,7 +3798,7 @@
 {
     PyThreadState *tstate = PyThreadState_GET();
 
-    /* substract one to ignore the frame of the get_recursion_depth() call */
+    /* subtract one to ignore the frame of the get_recursion_depth() call */
     return PyLong_FromLong(tstate->recursion_depth - 1);
 }
 
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index 968181c..0219559 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -45,7 +45,7 @@
 /* Helper to acquire an interruptible lock with a timeout.  If the lock acquire
  * is interrupted, signal handlers are run, and if they raise an exception,
  * PY_LOCK_INTR is returned.  Otherwise, PY_LOCK_ACQUIRED or PY_LOCK_FAILURE
- * are returned, depending on whether the lock can be acquired withing the
+ * are returned, depending on whether the lock can be acquired within the
  * timeout.
  */
 static PyLockStatus
diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
index e3329c7..48f5b47 100644
--- a/Modules/_tracemalloc.c
+++ b/Modules/_tracemalloc.c
@@ -716,7 +716,7 @@
 
         if (ADD_TRACE(ptr2, new_size) < 0) {
             /* Memory allocation failed. The error cannot be reported to
-               the caller, because realloc() may already have shrinked the
+               the caller, because realloc() may already have shrunk the
                memory block and so removed bytes.
 
                This case is very unlikely: a hash entry has just been
diff --git a/Modules/binascii.c b/Modules/binascii.c
index 50b09fe..c3320ce 100644
--- a/Modules/binascii.c
+++ b/Modules/binascii.c
@@ -837,7 +837,7 @@
     if (in_byte == RUNCHAR) {
         INBYTE(in_repeat);
         /* only 1 byte will be written, but 2 bytes were preallocated:
-           substract 1 byte to prevent overallocation */
+           subtract 1 byte to prevent overallocation */
         writer.min_size--;
 
         if (in_repeat != 0) {
@@ -858,7 +858,7 @@
         if (in_byte == RUNCHAR) {
             INBYTE(in_repeat);
             /* only 1 byte will be written, but 2 bytes were preallocated:
-               substract 1 byte to prevent overallocation */
+               subtract 1 byte to prevent overallocation */
             writer.min_size--;
 
             if ( in_repeat == 0 ) {
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 43aa229..95ea4f7 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -1274,7 +1274,7 @@
 
 /* Divide-and-conquer factorial algorithm
  *
- * Based on the formula and psuedo-code provided at:
+ * Based on the formula and pseudo-code provided at:
  * http://www.luschny.de/math/factorial/binarysplitfact.html
  *
  * Faster algorithms exist, but they're more complicated and depend on
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index d896cc0..f94c322 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -6611,7 +6611,7 @@
     PyModule_AddIntConstant(m, "SOMAXCONN", 5); /* Common value */
 #endif
 
-    /* Ancilliary message types */
+    /* Ancillary message types */
 #ifdef  SCM_RIGHTS
     PyModule_AddIntMacro(m, SCM_RIGHTS);
 #endif
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index e840271..6d5c68a 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -1315,7 +1315,7 @@
     return code;
 }
 
-/* Replace any occurances of "\r\n?" in the input string with "\n".
+/* Replace any occurrences of "\r\n?" in the input string with "\n".
    This converts DOS and Mac line endings to Unix line endings.
    Also append a trailing "\n" to be compatible with
    PyParser_SimpleParseFile(). Returns a new reference. */