Issue #27076: Doc, comment and test function name spelling fixes
Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
diff --git a/Lib/test/test_cookielib.py b/Lib/test/test_cookielib.py
index d272d12..a6568d7 100644
--- a/Lib/test/test_cookielib.py
+++ b/Lib/test/test_cookielib.py
@@ -1760,7 +1760,7 @@
key = "%s_after" % cookie.value
counter[key] = counter[key] + 1
- # a permanent cookie got lost accidently
+ # a permanent cookie got lost accidentally
self.assertEqual(counter["perm_after"], counter["perm_before"])
# a session cookie hasn't been cleared
self.assertEqual(counter["session_after"], 0)
diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py
index 19ffbcd..1f7fb776 100644
--- a/Lib/test/test_datetime.py
+++ b/Lib/test/test_datetime.py
@@ -882,7 +882,7 @@
#self.assertRaises(ValueError, t.strftime, "%#")
#oh well, some systems just ignore those invalid ones.
- #at least, excercise them to make sure that no crashes
+ #at least, exercise them to make sure that no crashes
#are generated
for f in ["%e", "%", "%#"]:
try:
@@ -1992,7 +1992,7 @@
hour_byte + base[1:])
# A mixin for classes with a tzinfo= argument. Subclasses must define
-# theclass as a class atribute, and theclass(1, 1, 1, tzinfo=whatever)
+# theclass as a class attribute, and theclass(1, 1, 1, tzinfo=whatever)
# must be legit (which is true for time and datetime).
class TZInfoBase:
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py
index 4b27424..7cf7d06 100644
--- a/Lib/test/test_doctest.py
+++ b/Lib/test/test_doctest.py
@@ -322,7 +322,7 @@
>>> test.lineno + e2.lineno
26
-If the docstring contains inconsistant leading whitespace in the
+If the docstring contains inconsistent leading whitespace in the
expected output of an example, then `DocTest` will raise a ValueError:
>>> docstring = r'''
diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
index 27399f7..5e1a3e5 100644
--- a/Lib/test/test_generators.py
+++ b/Lib/test/test_generators.py
@@ -1094,7 +1094,7 @@
# For each square, compute a bit vector of the columns and
# diagonals it covers, and for each row compute a function that
- # generates the possiblities for the columns in that row.
+ # generates the possibilities for the columns in that row.
self.rowgenerators = []
for i in rangen:
rowuses = [(1L << j) | # column ordinal
diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
index 76be461..471ebb4 100644
--- a/Lib/test/test_hashlib.py
+++ b/Lib/test/test_hashlib.py
@@ -408,7 +408,7 @@
pbkdf2_results = {
"sha1": [
- # offical test vectors from RFC 6070
+ # official test vectors from RFC 6070
(unhexlify('0c60c80f961f0e71f3a9b524af6012062fe037a6'), None),
(unhexlify('ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957'), None),
(unhexlify('4b007901b765489abead49d926f721d065a429c1'), None),
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index 6baaccf..62b36bd 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -1740,7 +1740,7 @@
# http://en.wikipedia.org/wiki/Cuboctahedron
# 8 triangular faces and 6 square faces
- # 12 indentical vertices each connecting a triangle and square
+ # 12 identical vertices each connecting a triangle and square
g = cube(3)
cuboctahedron = linegraph(g) # V( --> {V1, V2, V3, V4}
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 0ce80b9..4ae1e41 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -86,7 +86,7 @@
clientTearDown ()
Any new test functions within the class must then define
- tests in pairs, where the test name is preceeded with a
+ tests in pairs, where the test name is preceded with a
'_' to indicate the client portion of the test. Ex:
def testFoo(self):
diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py
index 6c122d7..1534e14 100644
--- a/Lib/test/test_telnetlib.py
+++ b/Lib/test/test_telnetlib.py
@@ -248,8 +248,8 @@
func = getattr(telnet, func_name)
self.assertRaises(EOFError, func)
- # read_eager and read_very_eager make the same gaurantees
- # (they behave differently but we only test the gaurantees)
+ # read_eager and read_very_eager make the same guarantees
+ # (they behave differently but we only test the guarantees)
def test_read_very_eager_A(self):
self._test_read_any_eager_A('read_very_eager')
def test_read_very_eager_B(self):
diff --git a/Lib/test/test_winsound.py b/Lib/test/test_winsound.py
index 4208fe7..c94a4dc 100644
--- a/Lib/test/test_winsound.py
+++ b/Lib/test/test_winsound.py
@@ -159,7 +159,7 @@
)
def test_alias_fallback(self):
- # In the absense of the ability to tell if a sound was actually
+ # In the absence of the ability to tell if a sound was actually
# played, this test has two acceptable outcomes: success (no error,
# sound was theoretically played; although as issue #19987 shows
# a box without a soundcard can "succeed") or RuntimeError. Any
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index 40033f2..4000b30 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -184,7 +184,7 @@
for f in (TESTFN2, TemporaryFile(), StringIO()):
self.zip_random_open_test(f, zipfile.ZIP_STORED)
- def test_univeral_readaheads(self):
+ def test_universal_readaheads(self):
f = StringIO()
data = 'a\r\n' * 16 * 1024