Issue #27076: Doc, comment and test function name spelling fixes
Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py
index 2cd1428..8d3e5d8 100644
--- a/Lib/_osx_support.py
+++ b/Lib/_osx_support.py
@@ -151,7 +151,7 @@
# can only be found inside Xcode.app if the "Command Line Tools"
# are not installed.
#
- # Futhermore, the compiler that can be used varies between
+ # Furthermore, the compiler that can be used varies between
# Xcode releases. Up to Xcode 4 it was possible to use 'gcc-4.2'
# as the compiler, after that 'clang' should be used because
# gcc-4.2 is either not present, or a copy of 'llvm-gcc' that
diff --git a/Lib/bsddb/test/test_lock.py b/Lib/bsddb/test/test_lock.py
index 10ca8d6..fd87ea2 100644
--- a/Lib/bsddb/test/test_lock.py
+++ b/Lib/bsddb/test/test_lock.py
@@ -41,7 +41,7 @@
print "locker ID: %s" % anID
lock = self.env.lock_get(anID, "some locked thing", db.DB_LOCK_WRITE)
if verbose:
- print "Aquired lock: %s" % lock
+ print "Acquired lock: %s" % lock
self.env.lock_put(lock)
if verbose:
print "Released lock: %s" % lock
@@ -158,7 +158,7 @@
for i in xrange(1000) :
lock = self.env.lock_get(anID, "some locked thing", lockType)
if verbose:
- print "%s: Aquired %s lock: %s" % (name, lt, lock)
+ print "%s: Acquired %s lock: %s" % (name, lt, lock)
self.env.lock_put(lock)
if verbose:
diff --git a/Lib/cgi.py b/Lib/cgi.py
index 64ba6d1..7c51b44 100755
--- a/Lib/cgi.py
+++ b/Lib/cgi.py
@@ -175,7 +175,7 @@
# parse query string function called from urlparse,
-# this is done in order to maintain backward compatiblity.
+# this is done in order to maintain backward compatibility.
def parse_qs(qs, keep_blank_values=0, strict_parsing=0):
"""Parse a query given as a string argument."""
diff --git a/Lib/collections.py b/Lib/collections.py
index 7ecfd46..f2ad972 100644
--- a/Lib/collections.py
+++ b/Lib/collections.py
@@ -314,7 +314,7 @@
>>> x, y = p # unpack like a regular tuple
>>> x, y
(11, 22)
- >>> p.x + p.y # fields also accessable by name
+ >>> p.x + p.y # fields also accessible by name
33
>>> d = p._asdict() # convert to a dictionary
>>> d['x']
diff --git a/Lib/distutils/msvc9compiler.py b/Lib/distutils/msvc9compiler.py
index 22de4ba..33d3e51 100644
--- a/Lib/distutils/msvc9compiler.py
+++ b/Lib/distutils/msvc9compiler.py
@@ -54,7 +54,7 @@
# A map keyed by get_platform() return values to values accepted by
# 'vcvarsall.bat'. Note a cross-compile may combine these (eg, 'x86_amd64' is
-# the param to cross-compile on x86 targetting amd64.)
+# the param to cross-compile on x86 targeting amd64.)
PLAT_TO_VCVARS = {
'win32' : 'x86',
'win-amd64' : 'amd64',
diff --git a/Lib/distutils/tests/test_unixccompiler.py b/Lib/distutils/tests/test_unixccompiler.py
index fec1ea6..3b893c1 100644
--- a/Lib/distutils/tests/test_unixccompiler.py
+++ b/Lib/distutils/tests/test_unixccompiler.py
@@ -135,7 +135,7 @@
self.assertEqual(self.cc.linker_so[0], 'my_cc')
@unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for OS X')
- def test_osx_explict_ldshared(self):
+ def test_osx_explicit_ldshared(self):
# Issue #18080:
# ensure that setting CC env variable does not change
# explicit LDSHARED setting for linker
diff --git a/Lib/email/parser.py b/Lib/email/parser.py
index 2fcaf25..6dad32a 100644
--- a/Lib/email/parser.py
+++ b/Lib/email/parser.py
@@ -23,7 +23,7 @@
textual representation of the message.
The string must be formatted as a block of RFC 2822 headers and header
- continuation lines, optionally preceeded by a `Unix-from' header. The
+ continuation lines, optionally preceded by a `Unix-from' header. The
header block is terminated either by the end of the string or by a
blank line.
diff --git a/Lib/encodings/utf_32.py b/Lib/encodings/utf_32.py
index 6c8016f..067e1e2 100644
--- a/Lib/encodings/utf_32.py
+++ b/Lib/encodings/utf_32.py
@@ -68,7 +68,7 @@
self.decoder = None
def getstate(self):
- # additonal state info from the base class must be None here,
+ # additional state info from the base class must be None here,
# as it isn't passed along to the caller
state = codecs.BufferedIncrementalDecoder.getstate(self)[0]
# additional state info we pass to the caller:
diff --git a/Lib/lib-tk/ttk.py b/Lib/lib-tk/ttk.py
index fe73aef..f7d0433 100644
--- a/Lib/lib-tk/ttk.py
+++ b/Lib/lib-tk/ttk.py
@@ -1014,7 +1014,7 @@
"""Begin autoincrement mode: schedules a recurring timer event
that calls method step every interval milliseconds.
- interval defaults to 50 milliseconds (20 steps/second) if ommited."""
+ interval defaults to 50 milliseconds (20 steps/second) if omitted."""
self.tk.call(self._w, "start", interval)
diff --git a/Lib/lib2to3/btm_utils.py b/Lib/lib2to3/btm_utils.py
index 2276dc9..501f834 100644
--- a/Lib/lib2to3/btm_utils.py
+++ b/Lib/lib2to3/btm_utils.py
@@ -216,7 +216,7 @@
#reduce to None
new_node = None
elif repeater_node.children[0].value == '+':
- #reduce to a single occurence i.e. do nothing
+ #reduce to a single occurrence i.e. do nothing
pass
else:
#TODO: handle {min, max} repeaters
diff --git a/Lib/lib2to3/fixes/fix_metaclass.py b/Lib/lib2to3/fixes/fix_metaclass.py
index 8399a13..45f9937 100644
--- a/Lib/lib2to3/fixes/fix_metaclass.py
+++ b/Lib/lib2to3/fixes/fix_metaclass.py
@@ -25,7 +25,7 @@
def has_metaclass(parent):
""" we have to check the cls_node without changing it.
- There are two possiblities:
+ There are two possibilities:
1) clsdef => suite => simple_stmt => expr_stmt => Leaf('__meta')
2) clsdef => simple_stmt => expr_stmt => Leaf('__meta')
"""
diff --git a/Lib/lib2to3/patcomp.py b/Lib/lib2to3/patcomp.py
index 093e5f9..d31a9da 100644
--- a/Lib/lib2to3/patcomp.py
+++ b/Lib/lib2to3/patcomp.py
@@ -3,7 +3,7 @@
"""Pattern compiler.
-The grammer is taken from PatternGrammar.txt.
+The grammar is taken from PatternGrammar.txt.
The compiler compiles a pattern to a pytree.*Pattern instance.
"""
diff --git a/Lib/locale.py b/Lib/locale.py
index 05f6316..3ce758f 100644
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -1835,7 +1835,7 @@
0x1809: "en_IE", # English - Ireland
0x1c09: "en_ZA", # English - South Africa
0x2009: "en_JA", # English - Jamaica
- 0x2409: "en_CB", # English - Carribbean
+ 0x2409: "en_CB", # English - Caribbean
0x2809: "en_BZ", # English - Belize
0x2c09: "en_TT", # English - Trinidad
0x3009: "en_ZW", # English - Zimbabwe
diff --git a/Lib/msilib/schema.py b/Lib/msilib/schema.py
index 003f040..b84eb22 100644
--- a/Lib/msilib/schema.py
+++ b/Lib/msilib/schema.py
@@ -731,7 +731,7 @@
(u'CustomAction',u'Type',u'N',1,16383,None, None, None, None, u'The numeric custom action type, consisting of source location, code type, entry, option flags.',),
(u'CustomAction',u'Action',u'N',None, None, None, None, u'Identifier',None, u'Primary key, name of action, normally appears in sequence table unless private use.',),
(u'CustomAction',u'Source',u'Y',None, None, None, None, u'CustomSource',None, u'The table reference of the source of the code.',),
-(u'CustomAction',u'Target',u'Y',None, None, None, None, u'Formatted',None, u'Excecution parameter, depends on the type of custom action',),
+(u'CustomAction',u'Target',u'Y',None, None, None, None, u'Formatted',None, u'Execution parameter, depends on the type of custom action',),
(u'DrLocator',u'Signature_',u'N',None, None, None, None, u'Identifier',None, u'The Signature_ represents a unique file signature and is also the foreign key in the Signature table.',),
(u'DrLocator',u'Path',u'Y',None, None, None, None, u'AnyPath',None, u'The path on the user system. This is a either a subpath below the value of the Parent or a full path. The path may contain properties enclosed within [ ] that will be expanded.',),
(u'DrLocator',u'Depth',u'Y',0,32767,None, None, None, None, u'The depth below the path to which the Signature_ is recursively searched. If absent, the depth is assumed to be 0.',),
diff --git a/Lib/mutex.py b/Lib/mutex.py
index f8acba4..3d8f428 100644
--- a/Lib/mutex.py
+++ b/Lib/mutex.py
@@ -9,7 +9,7 @@
implying it now has the lock.
Of course, no multi-threading is implied -- hence the funny interface
-for lock, where a function is called once the lock is aquired.
+for lock, where a function is called once the lock is acquired.
"""
from warnings import warnpy3k
warnpy3k("the mutex module has been removed in Python 3.0", stacklevel=2)
diff --git a/Lib/pstats.py b/Lib/pstats.py
index 4338994..3908f47 100644
--- a/Lib/pstats.py
+++ b/Lib/pstats.py
@@ -60,7 +60,7 @@
"""
def __init__(self, *args, **kwds):
- # I can't figure out how to explictly specify a stream keyword arg
+ # I can't figure out how to explicitly specify a stream keyword arg
# with *args:
# def __init__(self, *args, stream=sys.stdout): ...
# so I use **kwds and sqauwk if something unexpected is passed in.
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
diff --git a/Lib/unittest/result.py b/Lib/unittest/result.py
index 2cc17d7..8af972f 100644
--- a/Lib/unittest/result.py
+++ b/Lib/unittest/result.py
@@ -132,7 +132,7 @@
self.skipped.append((test, reason))
def addExpectedFailure(self, test, err):
- """Called when an expected failure/error occured."""
+ """Called when an expected failure/error occurred."""
self.expectedFailures.append(
(test, self._exc_info_to_string(err, test)))
diff --git a/Lib/wsgiref/headers.py b/Lib/wsgiref/headers.py
index 6c8c60c..5a95e84 100644
--- a/Lib/wsgiref/headers.py
+++ b/Lib/wsgiref/headers.py
@@ -59,7 +59,7 @@
Return None if the header is missing instead of raising an exception.
Note that if the header appeared multiple times, the first exactly which
- occurrance gets returned is undefined. Use getall() to get all
+ occurrence gets returned is undefined. Use getall() to get all
the values matching a header field name.
"""
return self.get(name)