[Python-checkins] Spelling fixes to docs, docstrings, and comments (GH-6374)

Miss Islington (bot) webhook-mailer at python.org
Fri Apr 20 17:00:45 EDT 2018


https://github.com/python/cpython/commit/32955299b4b102138220150e2925de4ce7f17c82
commit: 32955299b4b102138220150e2925de4ce7f17c82
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-04-20T14:00:41-07:00
summary:

Spelling fixes to docs, docstrings, and comments (GH-6374)

(cherry picked from commit 61f82e0e337f971da57f8f513abfe693edf95aa5)

Co-authored-by: Ville Skyttä <ville.skytta at iki.fi>

files:
M Doc/library/email.generator.rst
M Doc/library/test.rst
M Include/context.h
M Include/internal/hamt.h
M Lib/_strptime.py
M Lib/idlelib/NEWS.txt
M Lib/sqlite3/test/dbapi.py
M Lib/test/_test_multiprocessing.py
M Lib/test/test__xxsubinterpreters.py
M Lib/test/test_socket.py
M Lib/test/test_strptime.py
M Lib/typing.py
M Objects/dictobject.c
M Python/fileutils.c
M Python/hamt.c

diff --git a/Doc/library/email.generator.rst b/Doc/library/email.generator.rst
index cc8e8225a203..2575a5130070 100644
--- a/Doc/library/email.generator.rst
+++ b/Doc/library/email.generator.rst
@@ -185,7 +185,7 @@ to be using :class:`BytesGenerator`, and not :class:`Generator`.
       Convert any bytes with the high bit set as needed using an
       ASCII-compatible :mailheader:`Content-Transfer-Encoding`.  That is,
       transform parts with non-ASCII :mailheader:`Cotnent-Transfer-Encoding`
-      (:mailheader:`Content-Transfer-Encoding: 8bit`) to an ASCII compatibile
+      (:mailheader:`Content-Transfer-Encoding: 8bit`) to an ASCII compatible
       :mailheader:`Content-Transfer-Encoding`, and encode RFC-invalid non-ASCII
       bytes in headers using the MIME ``unknown-8bit`` character set, thus
       rendering them RFC-compliant.
diff --git a/Doc/library/test.rst b/Doc/library/test.rst
index 7b0971a83bcb..aeeed0042fce 100644
--- a/Doc/library/test.rst
+++ b/Doc/library/test.rst
@@ -746,7 +746,7 @@ The :mod:`test.support` module defines the following functions:
 
 .. function:: wait_threads_exit(timeout=60.0)
 
-   Context manager to wait until all threads created in the ``with`` statment
+   Context manager to wait until all threads created in the ``with`` statement
    exit.
 
 
diff --git a/Include/context.h b/Include/context.h
index f872dceee0ca..8b9f1292d75b 100644
--- a/Include/context.h
+++ b/Include/context.h
@@ -65,7 +65,7 @@ PyAPI_FUNC(PyContextToken *) PyContextVar_Set(
 
 
 /* Reset a variable to its previous value.
-   Returns 0 on sucess, -1 on error.
+   Returns 0 on success, -1 on error.
 */
 PyAPI_FUNC(int) PyContextVar_Reset(
     PyContextVar *var, PyContextToken *token);
diff --git a/Include/internal/hamt.h b/Include/internal/hamt.h
index 52488d0858df..29ad28b1d870 100644
--- a/Include/internal/hamt.h
+++ b/Include/internal/hamt.h
@@ -80,7 +80,7 @@ PyHamtObject * _PyHamt_Without(PyHamtObject *o, PyObject *key);
 /* Find "key" in the "o" collection.
 
    Return:
-   - -1: An error ocurred.
+   - -1: An error occurred.
    - 0: "key" wasn't found in "o".
    - 1: "key" is in "o"; "*val" is set to its value (a borrowed ref).
 */
diff --git a/Lib/_strptime.py b/Lib/_strptime.py
index 1be04850acf6..c8f2f94e5500 100644
--- a/Lib/_strptime.py
+++ b/Lib/_strptime.py
@@ -463,7 +463,7 @@ def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
                     z = z[:3] + z[4:]
                     if len(z) > 5:
                         if z[5] != ':':
-                            msg = f"Unconsistent use of : in {found_dict['z']}"
+                            msg = f"Inconsistent use of : in {found_dict['z']}"
                             raise ValueError(msg)
                         z = z[:5] + z[6:]
                 hours = int(z[1:3])
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
index c4aab2ee78b0..c8b0caabd284 100644
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -39,7 +39,7 @@ bpo-31860: The font sample in the settings dialog is now editable.
 Edits persist while IDLE remains open.
 Patch by Serhiy Storchake and Terry Jan Reedy.
 
-bpo-31858: Restrict shell prompt manipulaton to the shell.
+bpo-31858: Restrict shell prompt manipulation to the shell.
 Editor and output windows only see an empty last prompt line.  This
 simplifies the code and fixes a minor bug when newline is inserted.
 Sys.ps1, if present, is read on Shell start-up, but is not set or changed.
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py
index 5332975e0a65..7c259d2af418 100644
--- a/Lib/sqlite3/test/dbapi.py
+++ b/Lib/sqlite3/test/dbapi.py
@@ -161,7 +161,7 @@ def CheckInTransactionRO(self):
             self.cx.in_transaction = True
 
     def CheckOpenWithPathLikeObject(self):
-        """ Checks that we can succesfully connect to a database using an object that
+        """ Checks that we can successfully connect to a database using an object that
             is PathLike, i.e. has __fspath__(). """
         self.addCleanup(unlink, TESTFN)
         class Path:
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index c6a1f5ca9051..aa8eb7564130 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -1104,7 +1104,7 @@ def _on_queue_feeder_error(e, obj):
             q = SafeQueue(ctx=multiprocessing.get_context())
             q.put(not_serializable_obj)
 
-            # Verify that q is still functionning correctly
+            # Verify that q is still functioning correctly
             q.put(True)
             self.assertTrue(q.get(timeout=1.0))
 
diff --git a/Lib/test/test__xxsubinterpreters.py b/Lib/test/test__xxsubinterpreters.py
index 397d3599312b..4ef77716c662 100644
--- a/Lib/test/test__xxsubinterpreters.py
+++ b/Lib/test/test__xxsubinterpreters.py
@@ -1001,7 +1001,7 @@ def test_drop_close_if_unassociated(self):
             interpreters.channel_recv(cid)
 
     def test_drop_partially(self):
-        # XXX Is partial close too wierd/confusing?
+        # XXX Is partial close too weird/confusing?
         cid = interpreters.channel_create()
         interpreters.channel_send(cid, None)
         interpreters.channel_recv(cid)
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index bff1dc2d0638..44501d922ad3 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -5948,7 +5948,7 @@ def test_sendmsg_afalg_args(self):
 @unittest.skipUnless(sys.platform.startswith("win"), "requires Windows")
 class TestMSWindowsTCPFlags(unittest.TestCase):
     knownTCPFlags = {
-                       # avaliable since long time ago
+                       # available since long time ago
                        'TCP_MAXSEG',
                        'TCP_NODELAY',
                        # available starting with Windows 10 1607
diff --git a/Lib/test/test_strptime.py b/Lib/test/test_strptime.py
index af71008bec53..de2773f6aa29 100644
--- a/Lib/test/test_strptime.py
+++ b/Lib/test/test_strptime.py
@@ -363,7 +363,7 @@ def test_bad_offset(self):
             _strptime._strptime("-01:30:30:123456", "%z")
         with self.assertRaises(ValueError) as err:
             _strptime._strptime("-01:3030", "%z")
-        self.assertEqual("Unconsistent use of : in -01:3030", str(err.exception))
+        self.assertEqual("Inconsistent use of : in -01:3030", str(err.exception))
 
     def test_timezone(self):
         # Test timezone directives.
diff --git a/Lib/typing.py b/Lib/typing.py
index d45502ffee48..83296073b914 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -732,7 +732,7 @@ def __mro_entries__(self, bases):
         return (self.__origin__,)
 
     def __getattr__(self, attr):
-        # We are carefull for copy and pickle.
+        # We are careful for copy and pickle.
         # Also for simplicity we just don't relay all dunder names
         if '__origin__' in self.__dict__ and not _is_dunder(attr):
             return getattr(self.__origin__, attr)
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index acf757c9676a..7a1bcebec6fd 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -2573,7 +2573,7 @@ PyDict_Copy(PyObject *o)
            (3) if 'mp' is non-compact ('del' operation does not resize dicts),
                do fast-copy only if it has at most 1/3 non-used keys.
 
-           The last condition (3) is important to guard against a pathalogical
+           The last condition (3) is important to guard against a pathological
            case when a large dict is almost emptied with multiple del/pop
            operations and copied after that.  In cases like this, we defer to
            PyDict_Merge, which produces a compacted copy.
diff --git a/Python/fileutils.c b/Python/fileutils.c
index 32aeea4f1037..35869c81ac9f 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -431,7 +431,7 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen,
    can be decoded as a surrogate character, escape the bytes using the
    surrogateescape error handler instead of decoding them.
 
-   On sucess, return 0 and write the newly allocated wide character string into
+   On success, return 0 and write the newly allocated wide character string into
    *wstr (use PyMem_RawFree() to free the memory). If wlen is not NULL, write
    the number of wide characters excluding the null character into *wlen.
 
diff --git a/Python/hamt.c b/Python/hamt.c
index 53a85723745e..52171222b005 100644
--- a/Python/hamt.c
+++ b/Python/hamt.c
@@ -39,7 +39,7 @@ Now let's partition this bit representation of the hash into blocks of
     0b00_00000_10010_11101_00101_01011_10000 = 19830128
           (6)   (5)   (4)   (3)   (2)   (1)
 
-Each block of 5 bits represents a number betwen 0 and 31.  So if we have
+Each block of 5 bits represents a number between 0 and 31.  So if we have
 a tree that consists of nodes, each of which is an array of 32 pointers,
 those 5-bit blocks will encode a position on a single tree level.
 
@@ -832,7 +832,7 @@ hamt_node_bitmap_assoc(PyHamtNode_Bitmap *self,
                pairs.
 
                Small hamt objects (<30 keys) usually don't have any
-               Array nodes at all.  Betwen ~30 and ~400 keys hamt
+               Array nodes at all.  Between ~30 and ~400 keys hamt
                objects usually have one Array node, and usually it's
                a root node.
             */



More information about the Python-checkins mailing list