Skip to content

Commit

Permalink
Issue python#27076: Doc, comment and tests spelling fixes
Browse files Browse the repository at this point in the history
Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
  • Loading branch information
vadmium committed May 26, 2016
1 parent eb9aca3 commit 46f5072
Show file tree
Hide file tree
Showing 67 changed files with 241 additions and 241 deletions.
2 changes: 1 addition & 1 deletion Doc/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Glossary
A buffer is considered contiguous exactly if it is either
*C-contiguous* or *Fortran contiguous*. Zero-dimensional buffers are
C and Fortran contiguous. In one-dimensional arrays, the items
must be layed out in memory next to each other, in order of
must be laid out in memory next to each other, in order of
increasing indexes starting from zero. In multidimensional
C-contiguous arrays, the last index varies the fastest when
visiting items in order of memory address. However, in
Expand Down
2 changes: 1 addition & 1 deletion Lib/_osx_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def _find_appropriate_compiler(_config_vars):
# 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
Expand Down
2 changes: 1 addition & 1 deletion Lib/asyncio/sslproto.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ def _on_handshake_complete(self, handshake_exc):
self._wakeup_waiter()
self._session_established = True
# In case transport.write() was already called. Don't call
# immediatly _process_write_backlog(), but schedule it:
# immediately _process_write_backlog(), but schedule it:
# _on_handshake_complete() can be called indirectly from
# _process_write_backlog(), and _process_write_backlog() is not
# reentrant.
Expand Down
2 changes: 1 addition & 1 deletion Lib/cgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):


# 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."""
Expand Down
2 changes: 1 addition & 1 deletion Lib/collections/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def namedtuple(typename, field_names, verbose=False, rename=False):
>>> 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']
Expand Down
2 changes: 1 addition & 1 deletion Lib/dis.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def _get_instructions_bytes(code, varnames=None, names=None, constants=None,
argrepr = ''
if arg is not None:
# Set argval to the dereferenced value of the argument when
# availabe, and argrepr to the string representation of argval.
# available, and argrepr to the string representation of argval.
# _disassemble_bytes needs the string repr of the
# raw name index for LOAD_GLOBAL, LOAD_CONST, etc.
argval = arg
Expand Down
2 changes: 1 addition & 1 deletion Lib/distutils/msvc9compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,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',
Expand Down
2 changes: 1 addition & 1 deletion Lib/distutils/tests/test_unixccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def gcv(v):
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
Expand Down
2 changes: 1 addition & 1 deletion Lib/email/_header_value_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2872,7 +2872,7 @@ def parse_content_type_header(value):
_find_mime_parameters(ctype, value)
return ctype
ctype.append(token)
# XXX: If we really want to follow the formal grammer we should make
# XXX: If we really want to follow the formal grammar we should make
# mantype and subtype specialized TokenLists here. Probably not worth it.
if not value or value[0] != '/':
ctype.defects.append(errors.InvalidHeaderDefect(
Expand Down
4 changes: 2 additions & 2 deletions Lib/email/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, _class=None, *, policy=compat32):
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.
Expand Down Expand Up @@ -87,7 +87,7 @@ def __init__(self, *args, **kw):
textual representation of the message.
The input 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 input or by a
blank line.
Expand Down
2 changes: 1 addition & 1 deletion Lib/encodings/utf_16.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def reset(self):
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:
Expand Down
2 changes: 1 addition & 1 deletion Lib/encodings/utf_32.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def reset(self):
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:
Expand Down
2 changes: 1 addition & 1 deletion Lib/html/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def goahead(self, end):
# or there's more text incoming. If the latter is True,
# we can't pass the text to handle_data in case we have
# a charref cut in half at end. Try to determine if
# this is the case before proceding by looking for an
# this is the case before proceeding by looking for an
# & near the end and see if it's followed by a space or ;.
amppos = rawdata.rfind('&', max(i, n-34))
if (amppos >= 0 and
Expand Down
2 changes: 1 addition & 1 deletion Lib/http/cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class CookieError(Exception):
# a two-way quoting algorithm. Any non-text character is translated
# into a 4 character sequence: a forward-slash followed by the
# three-digit octal equivalent of the character. Any '\' or '"' is
# quoted with a preceeding '\' slash.
# quoted with a preceding '\' slash.
# Because of the way browsers really handle cookies (as opposed to what
# the RFC says) we also encode "," and ";".
#
Expand Down
2 changes: 1 addition & 1 deletion Lib/importlib/_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ def _calc___package__(globals):
def __import__(name, globals=None, locals=None, fromlist=(), level=0):
"""Import a module.
The 'globals' argument is used to infer where the import is occuring from
The 'globals' argument is used to infer where the import is occurring from
to handle relative imports. The 'locals' argument is ignored. The
'fromlist' argument specifies what should exist as attributes on the module
being imported (e.g. ``from module import <fromlist>``). The 'level'
Expand Down
2 changes: 1 addition & 1 deletion Lib/lib2to3/btm_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def reduce_tree(node, parent=None):
#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
Expand Down
2 changes: 1 addition & 1 deletion Lib/lib2to3/fixes/fix_metaclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
"""
Expand Down
2 changes: 1 addition & 1 deletion Lib/lib2to3/patcomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
2 changes: 1 addition & 1 deletion Lib/locale.py
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,7 @@ def getpreferredencoding(do_setlocale = True):
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
Expand Down
2 changes: 1 addition & 1 deletion Lib/msilib/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@
('CustomAction','Type','N',1,16383,None, None, None, None, 'The numeric custom action type, consisting of source location, code type, entry, option flags.',),
('CustomAction','Action','N',None, None, None, None, 'Identifier',None, 'Primary key, name of action, normally appears in sequence table unless private use.',),
('CustomAction','Source','Y',None, None, None, None, 'CustomSource',None, 'The table reference of the source of the code.',),
('CustomAction','Target','Y',None, None, None, None, 'Formatted',None, 'Excecution parameter, depends on the type of custom action',),
('CustomAction','Target','Y',None, None, None, None, 'Formatted',None, 'Execution parameter, depends on the type of custom action',),
('DrLocator','Signature_','N',None, None, None, None, 'Identifier',None, 'The Signature_ represents a unique file signature and is also the foreign key in the Signature table.',),
('DrLocator','Path','Y',None, None, None, None, 'AnyPath',None, 'The path on the user system. This is either a subpath below the value of the Parent or a full path. The path may contain properties enclosed within [ ] that will be expanded.',),
('DrLocator','Depth','Y',0,32767,None, None, None, None, 'The depth below the path to which the Signature_ is recursively searched. If absent, the depth is assumed to be 0.',),
Expand Down
2 changes: 1 addition & 1 deletion Lib/pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def user_exception(self, frame, exc_info):

# An 'Internal StopIteration' exception is an exception debug event
# issued by the interpreter when handling a subgenerator run with
# 'yield from' or a generator controled by a for loop. No exception has
# 'yield from' or a generator controlled by a for loop. No exception has
# actually occurred in this case. The debugger uses this debug event to
# stop when the debuggee is returning from such generators.
prefix = 'Internal ' if (not exc_traceback
Expand Down
2 changes: 1 addition & 1 deletion Lib/pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ def __init__(self, file, *, fix_imports=True,
meets this interface.
Optional keyword arguments are *fix_imports*, *encoding* and
*errors*, which are used to control compatiblity support for
*errors*, which are used to control compatibility support for
pickle stream generated by Python 2. If *fix_imports* is True,
pickle will try to map the old Python 2 names to the new names
used in Python 3. The *encoding* and *errors* tell pickle how
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/cfgparser.2
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
# either /etc/hosts OR DNS or NIS depending on the settings of
# /etc/host.config, /etc/nsswitch.conf
# and the /etc/resolv.conf file. "host" therefore is system
# configuration dependant. This parameter is most often of use to
# configuration dependent. This parameter is most often of use to
# prevent DNS lookups
# in order to resolve NetBIOS names to IP Addresses. Use with care!
# The example below excludes use of name resolution for machines that
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/datetimetester.py
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ def test_strftime(self):
#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:
Expand Down Expand Up @@ -2476,7 +2476,7 @@ def test_backdoor_resistance(self):
self.theclass(bytes([1] * len(base)), 'EST')

# 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:

Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_asyncio/test_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def kill_running():
transport, protocol = yield from create
proc = transport.get_extra_info('subprocess')

# kill the process (but asyncio is not notified immediatly)
# kill the process (but asyncio is not notified immediately)
proc.kill()
proc.wait()

Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_capi.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def test_skipitem(self):
test and not for the other, there's a mismatch, and the test fails.
** Some format units have special funny semantics and it would
be difficult to accomodate them here. Since these are all
be difficult to accommodate them here. Since these are all
well-established and properly skipped in skipitem() we can
get away with not testing them--this test is really intended
to catch *new* format units.
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_concurrent_futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ def test_result_with_timeout(self):
self.assertEqual(SUCCESSFUL_FUTURE.result(timeout=0), 42)

def test_result_with_success(self):
# TODO([email protected]): This test is timing dependant.
# TODO([email protected]): This test is timing dependent.
def notification():
# Wait until the main thread is waiting for the result.
time.sleep(1)
Expand All @@ -689,7 +689,7 @@ def notification():
self.assertEqual(f1.result(timeout=5), 42)

def test_result_with_cancel(self):
# TODO([email protected]): This test is timing dependant.
# TODO([email protected]): This test is timing dependent.
def notification():
# Wait until the main thread is waiting for the result.
time.sleep(1)
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_crypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_saltedcrypt(self):
self.assertEqual(len(pw), method.total_size)

def test_methods(self):
# Gurantee that METHOD_CRYPT is the last method in crypt.methods.
# Guarantee that METHOD_CRYPT is the last method in crypt.methods.
self.assertTrue(len(crypt.methods) >= 1)
self.assertEqual(crypt.METHOD_CRYPT, crypt.methods[-1])

Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def test_DocTest(): r"""
>>> 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'''
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_email/test__header_value_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2498,7 +2498,7 @@ def mime_parameters_as_value(self,
# Note that it is undefined what we should do for error recovery when
# there are duplicate parameter names or duplicate parts in a split
# part. We choose to ignore all duplicate parameters after the first
# and to take duplicate or missing rfc 2231 parts in apperance order.
# and to take duplicate or missing rfc 2231 parts in appearance order.
# This is backward compatible with get_param's behavior, but the
# decisions are arbitrary.

Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_email/test_contentmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ def test_set_video_mpeg_with_binary_cte(self):
self.assertEqual(m.get_content(), content)

def test_set_application_octet_stream_with_8bit_cte(self):
# In 8bit mode, univeral line end logic applies. It is up to the
# In 8bit mode, universal line end logic applies. It is up to the
# application to make sure the lines are short enough; we don't check.
m = self._make_message()
content = b'b\xFFgus\tcon\nt\rent\n' + b'z'*60 + b'\n'
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_functools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,7 @@ def test_compose_mro(self):
object])

# MutableSequence below is registered directly on D. In other words, it
# preceeds MutableMapping which means single dispatch will always
# precedes MutableMapping which means single dispatch will always
# choose MutableSequence here.
class D(c.defaultdict):
pass
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ def __init__(self, n):

# 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 = [(1 << j) | # column ordinal
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_hashlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ class KDFTests(unittest.TestCase):

pbkdf2_results = {
"sha1": [
# offical test vectors from RFC 6070
# official test vectors from RFC 6070
(bytes.fromhex('0c60c80f961f0e71f3a9b524af6012062fe037a6'), None),
(bytes.fromhex('ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957'), None),
(bytes.fromhex('4b007901b765489abead49d926f721d065a429c1'), None),
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_http_cookiejar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ def test_session_cookies(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_httpservers.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def do_NOTFOUND(self):

def do_EXPLAINERROR(self):
self.send_error(999, "Short Message",
"This is a long \n explaination")
"This is a long \n explanation")

def do_CUSTOM(self):
self.send_response(999)
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_linecache.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def test_lazycache_smoke(self):
self.assertEqual(
True, linecache.lazycache(NONEXISTENT_FILENAME, globals()))
self.assertEqual(1, len(linecache.cache[NONEXISTENT_FILENAME]))
# Note here that we're looking up a non existant filename with no
# Note here that we're looking up a nonexistent filename with no
# globals: this would error if the lazy value wasn't resolved.
self.assertEqual(lines, linecache.getlines(NONEXISTENT_FILENAME))

Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_lzma.py
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ def test_encoding(self):
self.assertEqual(f.read(), uncompressed)

def test_encoding_error_handler(self):
# Test wih non-default encoding error handler.
# Test with non-default encoding error handler.
with BytesIO(lzma.compress(b"foo\xffbar")) as bio:
with lzma.open(bio, "rt", encoding="ascii", errors="ignore") as f:
self.assertEqual(f.read(), "foobar")
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_memoryio.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def __init__(me, initvalue, foo):

# Pickle expects the class to be on the module level. Here we use a
# little hack to allow the PickleTestMemIO class to derive from
# self.ioclass without having to define all combinations explictly on
# self.ioclass without having to define all combinations explicitly on
# the module-level.
import __main__
PickleTestMemIO.__module__ = '__main__'
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ def test_pdb_until_command_for_generator():
"""

def test_pdb_next_command_in_generator_for_loop():
"""The next command on returning from a generator controled by a for loop.
"""The next command on returning from a generator controlled by a for loop.
>>> def test_gen():
... yield 0
Expand Down
Loading

0 comments on commit 46f5072

Please sign in to comment.