]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.7] Fix typos in docs, comments and test assert messages (GH-14872). (#14901)
authorKyle Stanley <aeros167@gmail.com>
Mon, 22 Jul 2019 18:14:07 +0000 (14:14 -0400)
committerTerry Jan Reedy <tjreedy@udel.edu>
Mon, 22 Jul 2019 18:14:07 +0000 (14:14 -0400)
(cherry picked from commit 96e12d5f4f3c5a20986566038ee763dff3c228a1)

Co-authored-by: Min ho Kim <minho42@gmail.com>
13 files changed:
Doc/library/ctypes.rst
Lib/collections/__init__.py
Lib/dataclasses.py
Lib/email/headerregistry.py
Lib/importlib/_bootstrap_external.py
Lib/test/support/__init__.py
Lib/test/test_dataclasses.py
Lib/test/test_eintr.py
Lib/test/test_random.py
Misc/NEWS.d/3.5.2rc1.rst
Misc/NEWS.d/3.6.0a1.rst
Misc/NEWS.d/3.6.3rc1.rst
Modules/_pickle.c

index 6cd4f9779f6ddbeaa55ff4e7d725763434e1bdc8..2eafa654e2e64ea7b0f897bfb3f2264690ef0269 100644 (file)
@@ -1175,7 +1175,7 @@ Keep in mind that retrieving sub-objects from Structure, Unions, and Arrays
 doesn't *copy* the sub-object, instead it retrieves a wrapper object accessing
 the root-object's underlying buffer.
 
-Another example that may behave different from what one would expect is this::
+Another example that may behave differently from what one would expect is this::
 
    >>> s = c_char_p()
    >>> s.value = b"abc def ghi"
index 64bbee8faba8978f2fed8fdd693572b4d96885e9..7ff3c80a06a7e8aa38e27ad82dd750f2a7629717 100644 (file)
@@ -444,7 +444,7 @@ def namedtuple(typename, field_names, *, rename=False, defaults=None, module=Non
         '__slots__': (),
         '_fields': field_names,
         '_field_defaults': field_defaults,
-        # alternate spelling for backward compatiblity
+        # alternate spelling for backward compatibility
         '_fields_defaults': field_defaults,
         '__new__': __new__,
         '_make': _make,
index 8c3d638e86bc58e316480ce39b2fb764385635be..7725621e0faed458996bfbf6c938235e450cf261 100644 (file)
@@ -1185,7 +1185,7 @@ def make_dataclass(cls_name, fields, *, bases=(), namespace=None, init=True,
             raise TypeError(f'Invalid field: {item!r}')
 
         if not isinstance(name, str) or not name.isidentifier():
-            raise TypeError(f'Field names must be valid identifers: {name!r}')
+            raise TypeError(f'Field names must be valid identifiers: {name!r}')
         if keyword.iskeyword(name):
             raise TypeError(f'Field names must not be keywords: {name!r}')
         if name in seen:
index 00652049f2fa2fc5ca53769f87b523d551ecc23b..0218cbfbd098d4e62df373890e2e552d1572f062 100644 (file)
@@ -245,7 +245,7 @@ class BaseHeader(str):
         the header name and the ': ' separator.
 
         """
-        # At some point we need to put fws here iif it was in the source.
+        # At some point we need to put fws here if it was in the source.
         header = parser.Header([
             parser.HeaderLabel([
                 parser.ValueTerminal(self.name, 'header-name'),
index 53b24ff1b0f223902cd48bc2c9ef55d135183240..66a16a68396266d0458e3f55ca5044f7465e7aed 100644 (file)
@@ -246,7 +246,7 @@ _code_type = type(_write_atomic.__code__)
 #     Python 3.7a2  3391 (update GET_AITER #31709)
 #     Python 3.7a4  3392 (PEP 552: Deterministic pycs #31650)
 #     Python 3.7b1  3393 (remove STORE_ANNOTATION opcode #32550)
-#     Python 3.7b5  3394 (restored docstring as the firts stmt in the body;
+#     Python 3.7b5  3394 (restored docstring as the first stmt in the body;
 #                         this might affected the first line number #32911)
 #
 # MAGIC must change whenever the bytecode emitted by the compiler may no
index 87bfa9f546272e8dfa847c9d0933e2440b001649..6e40a143c2747cc3c5691a9538d5693759fd2372 100644 (file)
@@ -2806,7 +2806,7 @@ def fd_count():
     if sys.platform.startswith(('linux', 'freebsd')):
         try:
             names = os.listdir("/proc/self/fd")
-            # Substract one because listdir() opens internally a file
+            # Subtract one because listdir() internally opens a file
             # descriptor to list the content of the /proc/self/fd/ directory.
             return len(names) - 1
         except FileNotFoundError:
index a2c7ceea9da23fec905660871c05782a4570e935..f36098c6933910dc387d8c69a5ebcc6b52c120af 100755 (executable)
@@ -3037,11 +3037,11 @@ class TestMakeDataclass(unittest.TestCase):
     def test_non_identifier_field_names(self):
         for field in ['()', 'x,y', '*', '2@3', '', 'little johnny tables']:
             with self.subTest(field=field):
-                with self.assertRaisesRegex(TypeError, 'must be valid identifers'):
+                with self.assertRaisesRegex(TypeError, 'must be valid identifiers'):
                     make_dataclass('C', ['a', field])
-                with self.assertRaisesRegex(TypeError, 'must be valid identifers'):
+                with self.assertRaisesRegex(TypeError, 'must be valid identifiers'):
                     make_dataclass('C', [field])
-                with self.assertRaisesRegex(TypeError, 'must be valid identifers'):
+                with self.assertRaisesRegex(TypeError, 'must be valid identifiers'):
                     make_dataclass('C', [field, 'a'])
 
     def test_underscore_field_names(self):
index f61efa3c648e6677631a0f14194205a033f63389..a5f8f6465e88b8a966be488f462e8c1a3b6438cf 100644 (file)
@@ -22,7 +22,7 @@ class EINTRTests(unittest.TestCase):
             print()
             print("--- run eintr_tester.py ---", flush=True)
             # In verbose mode, the child process inherit stdout and stdout,
-            # to see output in realtime and reduce the risk of loosing output.
+            # to see output in realtime and reduce the risk of losing output.
             args = [sys.executable, "-E", "-X", "faulthandler", *args]
             proc = subprocess.run(args)
             print(f"--- eintr_tester.py completed: "
index f0822cddec86100fc44b4e51573ec9e558b9a7e8..6b9e90594cb29879873bbb4bf9a6a4acee14aa43 100644 (file)
@@ -228,7 +228,7 @@ class TestBasicOps:
             choices([], cum_weights=[], k=5)
 
     def test_choices_subnormal(self):
-        # Subnormal weights would occassionally trigger an IndexError
+        # Subnormal weights would occasionally trigger an IndexError
         # in choices() when the value returned by random() was large
         # enough to make `random() * total` round up to the total.
         # See https://bugs.python.org/msg275594 for more detail.
index 231c3cac9c5f4afdebf19487de1b37ea3db2715e..40b9e803da29e72908eeaa2e4be512308235f0a7 100644 (file)
@@ -2006,7 +2006,7 @@ Adds validation of ucrtbase[d].dll version with warning for old versions.
 .. nonce: 102DA-
 .. section: Build
 
-Avoid error about nonexistant fileblocks.o file by using a lower-level check
+Avoid error about nonexistent fileblocks.o file by using a lower-level check
 for st_blocks in struct stat.
 
 ..
index 254d36166450365dfc5e4057e777cf1edc72e093..2df4c613a8e82fa0b404ddfb1696a4a6a7ed9b31 100644 (file)
@@ -3695,7 +3695,7 @@ Adds validation of ucrtbase[d].dll version with warning for old versions.
 .. nonce: 102DA-
 .. section: Build
 
-Avoid error about nonexistant fileblocks.o file by using a lower-level check
+Avoid error about nonexistent fileblocks.o file by using a lower-level check
 for st_blocks in struct stat.
 
 ..
index ca812c63eed901bfe8f13e7a49ee94889d35d614..29cff7eae77f311dd1478c06e4792b3968571889 100644 (file)
@@ -885,8 +885,7 @@ The affected events are '<<force-open-completions>>', '<<expand-word>>',
 '<<run-module>>', '<<check-module>>', and '<<zoom-height>>'.  Any (global)
 customizations made before 3.6.3 will not affect their keyset-specific
 customization after 3.6.3. and vice versa.
-
-Inital patch by Charles Wohlganger.
+Initial patch by Charles Wohlganger.
 
 ..
 
index 9a6207b519fafc514e42bd462b534c5ed4bc9129..dd45772595bc9d6f548b2459dbe798c06e91efd3 100644 (file)
@@ -1999,7 +1999,7 @@ save_long(PicklerObject *self, PyObject *obj)
         /* How many bytes do we need?  There are nbits >> 3 full
          * bytes of data, and nbits & 7 leftover bits.  If there
          * are any leftover bits, then we clearly need another
-         * byte.  Wnat's not so obvious is that we *probably*
+         * byte.  What's not so obvious is that we *probably*
          * need another byte even if there aren't any leftovers:
          * the most-significant bit of the most-significant byte
          * acts like a sign bit, and it's usually got a sense