Skip to content

Commit

Permalink
Fix typos in comments, docs and test names (python#15018)
Browse files Browse the repository at this point in the history
* Fix typos in comments, docs and test names

* Update test_pyparse.py

account for change in string length

* Apply suggestion: splitable -> splittable

Co-Authored-By: Terry Jan Reedy <[email protected]>

* Apply suggestion: splitable -> splittable

Co-Authored-By: Terry Jan Reedy <[email protected]>

* Apply suggestion: Dealloccte -> Deallocate

Co-Authored-By: Terry Jan Reedy <[email protected]>

* Update posixmodule checksum.

* Reverse idlelib changes.
  • Loading branch information
minho42 authored and terryjreedy committed Jul 30, 2019
1 parent 0acb646 commit c4cacc8
Show file tree
Hide file tree
Showing 63 changed files with 73 additions and 73 deletions.
2 changes: 1 addition & 1 deletion Doc/library/email.encoders.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ the :meth:`~email.message.EmailMessage.set_content` method.
This module is deprecated in Python 3. The functions provided here
should not be called explicitly since the :class:`~email.mime.text.MIMEText`
class sets the content type and CTE header using the *_subtype* and *_charset*
values passed during the instaniation of that class.
values passed during the instantiation of that class.

The remaining text in this section is the original documentation of the module.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/statistics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ However, for reading convenience, most of the examples show sorted sequences.
>>> [round(q, 1) for q in quantiles(data, n=10)]
[81.0, 86.2, 89.0, 99.4, 102.5, 103.6, 106.0, 109.8, 111.0]

>>> # Quartile cut points for the standard normal distibution
>>> # Quartile cut points for the standard normal distribution
>>> Z = NormalDist()
>>> [round(q, 4) for q in quantiles(Z, n=4)]
[-0.6745, 0.0, 0.6745]
Expand Down
2 changes: 1 addition & 1 deletion Include/abstract.h
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ PyAPI_FUNC(PyObject *) PySequence_Fast(PyObject *o, const char* m);
(PyList_Check(o) ? PyList_GET_ITEM(o, i) : PyTuple_GET_ITEM(o, i))

/* Return a pointer to the underlying item array for
an object retured by PySequence_Fast */
an object returned by PySequence_Fast */
#define PySequence_Fast_ITEMS(sf) \
(PyList_Check(sf) ? ((PyListObject *)(sf))->ob_item \
: ((PyTupleObject *)(sf))->ob_item)
Expand Down
2 changes: 1 addition & 1 deletion Include/ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PyAPI_FUNC(mod_ty) PyAST_FromNodeObject(
PyAPI_FUNC(PyObject *) _PyAST_ExprAsUnicode(expr_ty);

/* Return the borrowed reference to the first literal string in the
sequence of statemnts or NULL if it doesn't start from a literal string.
sequence of statements or NULL if it doesn't start from a literal string.
Doesn't set exception. */
PyAPI_FUNC(PyObject *) _PyAST_GetDocString(asdl_seq *);

Expand Down
2 changes: 1 addition & 1 deletion Include/pymath.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ PyAPI_FUNC(void) _Py_set_387controlword(unsigned short);

/* Py_IS_FINITE(X)
* Return 1 if float or double arg is neither infinite nor NAN, else 0.
* Some compilers (e.g. VisualStudio) have intrisics for this, so a special
* Some compilers (e.g. VisualStudio) have intrinsics for this, so a special
* macro for this particular test is useful
* Note: PC/pyconfig.h defines Py_IS_FINITE as _finite
*/
Expand Down
2 changes: 1 addition & 1 deletion Lib/_pyio.py
Original file line number Diff line number Diff line change
Expand Up @@ -1573,7 +1573,7 @@ def __init__(self, file, mode='r', closefd=True, opener=None):
raise IsADirectoryError(errno.EISDIR,
os.strerror(errno.EISDIR), file)
except AttributeError:
# Ignore the AttribueError if stat.S_ISDIR or errno.EISDIR
# Ignore the AttributeError if stat.S_ISDIR or errno.EISDIR
# don't exist.
pass
self._blksize = getattr(fdfstat, 'st_blksize', 0)
Expand Down
2 changes: 1 addition & 1 deletion Lib/asyncio/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def __init__(self, loop=None, *, _asyncio_internal=False):
# Avoid inheritance from FlowControlMixin
# Copy-paste the code to your project
# if you need flow control helpers
warnings.warn(f"{self.__class__} should be instaniated "
warnings.warn(f"{self.__class__} should be instantiated "
"by asyncio internals only, "
"please avoid its creation from user code",
DeprecationWarning)
Expand Down
2 changes: 1 addition & 1 deletion Lib/asyncio/subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def _get_close_waiter(self, stream):
class Process:
def __init__(self, transport, protocol, loop, *, _asyncio_internal=False):
if not _asyncio_internal:
warnings.warn(f"{self.__class__} should be instaniated "
warnings.warn(f"{self.__class__} should be instantiated "
"by asyncio internals only, "
"please avoid its creation from user code",
DeprecationWarning)
Expand Down
2 changes: 1 addition & 1 deletion Lib/imaplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def deleteacl(self, mailbox, who):
def enable(self, capability):
"""Send an RFC5161 enable string to the server.
(typ, [data]) = <intance>.enable(capability)
(typ, [data]) = <instance>.enable(capability)
"""
if 'ENABLE' not in self.capabilities:
raise IMAP4.error("Server does not support ENABLE")
Expand Down
2 changes: 1 addition & 1 deletion Lib/lib2to3/fixer_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def _find(name, node):
return None

def _is_import_binding(node, name, package=None):
""" Will reuturn node if node will import name, or node
""" Will return node if node will import name, or node
will import * from package. None is returned otherwise.
See test cases for examples. """

Expand Down
2 changes: 1 addition & 1 deletion Lib/lib2to3/tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ def test_4(self):

# Adapted from Python 3's Lib/test/test_unicode_identifiers.py and
# Lib/test/test_tokenize.py:TokenizeTest.test_non_ascii_identifiers
class TestIdentfier(GrammarTest):
class TestIdentifier(GrammarTest):
def test_non_ascii_identifiers(self):
self.validate("Örter = 'places'\ngrün = 'green'")
self.validate("蟒 = a蟒 = 锦蛇 = 1")
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/libregrtest/win_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class WindowsLoadTracker():
"""
This class asynchronously interacts with the `typeperf` command to read
the system load on Windows. Mulitprocessing and threads can't be used
the system load on Windows. Multiprocessing and threads can't be used
here because they interfere with the test suite's cases for those
modules.
"""
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ def test_invalid_sum(self):
compile(m, "<test>", "exec")
self.assertIn("but got <_ast.expr", str(cm.exception))

def test_invalid_identitifer(self):
def test_invalid_identifier(self):
m = ast.Module([ast.Expr(ast.Name(42, ast.Load()))], [])
ast.fix_missing_locations(m)
with self.assertRaises(TypeError) as cm:
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_cmd_line_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ def test_consistent_sys_path_for_module_execution(self):
def test_nonexisting_script(self):
# bpo-34783: "./python script.py" must not crash
# if the script file doesn't exist.
# (Skip test for macOS framework builds because sys.excutable name
# (Skip test for macOS framework builds because sys.executable name
# is not the actual Python executable file name.
script = 'nonexistingscript.py'
self.assertFalse(os.path.exists(script))
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ def test_tupleness(self):

self.assertIsInstance(p, tuple)
self.assertEqual(p, (11, 22)) # matches a real tuple
self.assertEqual(tuple(p), (11, 22)) # coercable to a real tuple
self.assertEqual(list(p), [11, 22]) # coercable to a list
self.assertEqual(tuple(p), (11, 22)) # coercible to a real tuple
self.assertEqual(list(p), [11, 22]) # coercible to a list
self.assertEqual(max(p), 22) # iterable
self.assertEqual(max(*p), 22) # star-able
x, y = p
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_compileall.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,14 +578,14 @@ def test_workers_available_cores(self, compile_dir):
self.assertEqual(compile_dir.call_args[-1]['workers'], 0)


class CommmandLineTestsWithSourceEpoch(CommandLineTestsBase,
class CommandLineTestsWithSourceEpoch(CommandLineTestsBase,
unittest.TestCase,
metaclass=SourceDateEpochTestMeta,
source_date_epoch=True):
pass


class CommmandLineTestsNoSourceEpoch(CommandLineTestsBase,
class CommandLineTestsNoSourceEpoch(CommandLineTestsBase,
unittest.TestCase,
metaclass=SourceDateEpochTestMeta,
source_date_epoch=False):
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 @@ -2485,7 +2485,7 @@ def test_unittest_reportflags():

def test_testfile(): r"""
Tests for the `testfile()` function. This function runs all the
doctest examples in a given file. In its simple invokation, it is
doctest examples in a given file. In its simple invocation, it is
called with the name of a file, which is taken to be relative to the
calling module. The return value is (#failures, #tests).
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 @@ -297,7 +297,7 @@ def test_get_unstructured_ew_with_internal_leading_ws(self):
[],
'')

def test_get_unstructured_invaild_ew(self):
def test_get_unstructured_invalid_ew(self):
self._test_get_x(self._get_unst,
'=?test val',
'=?test val',
Expand Down
10 changes: 5 additions & 5 deletions Lib/test/test_email/test_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ def test_last_split_chunk_does_not_fit(self):
Subject: the first part of this is short,
but_the_second_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself""")

def test_splittable_leading_char_followed_by_overlong_unsplitable(self):
def test_splittable_leading_char_followed_by_overlong_unsplittable(self):
eq = self.ndiffAssertEqual
h = Header(', but_the_second'
'_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line'
Expand All @@ -1017,7 +1017,7 @@ def test_splittable_leading_char_followed_by_overlong_unsplitable(self):
,
but_the_second_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself""")

def test_multiple_splittable_leading_char_followed_by_overlong_unsplitable(self):
def test_multiple_splittable_leading_char_followed_by_overlong_unsplittable(self):
eq = self.ndiffAssertEqual
h = Header(', , but_the_second'
'_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line'
Expand All @@ -1026,14 +1026,14 @@ def test_multiple_splittable_leading_char_followed_by_overlong_unsplitable(self)
, ,
but_the_second_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself""")

def test_trailing_splitable_on_overlong_unsplitable(self):
def test_trailing_splittable_on_overlong_unsplittable(self):
eq = self.ndiffAssertEqual
h = Header('this_part_does_not_fit_within_maxlinelen_and_thus_should_'
'be_on_a_line_all_by_itself;')
eq(h.encode(), "this_part_does_not_fit_within_maxlinelen_and_thus_should_"
"be_on_a_line_all_by_itself;")

def test_trailing_splitable_on_overlong_unsplitable_with_leading_splitable(self):
def test_trailing_splittable_on_overlong_unsplittable_with_leading_splittable(self):
eq = self.ndiffAssertEqual
h = Header('; '
'this_part_does_not_fit_within_maxlinelen_and_thus_should_'
Expand Down Expand Up @@ -1466,7 +1466,7 @@ def test_mangled_from_with_bad_bytes(self):
g.flatten(msg)
self.assertEqual(b.getvalue(), source + b'>From R\xc3\xb6lli\n')

def test_mutltipart_with_bad_bytes_in_cte(self):
def test_multipart_with_bad_bytes_in_cte(self):
# bpo30835
source = textwrap.dedent("""\
From: [email protected]
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_importlib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def test_absolute_path(self):
self.execute(data01, full_path)

def test_relative_path(self):
# A reative path is a ValueError.
# A relative path is a ValueError.
with self.assertRaises(ValueError):
self.execute(data01, '../data01/utf-8.file')

Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_mailbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,7 @@ def test_initialize_incorrectly(self):
# Initialize with invalid argument
self.assertRaises(TypeError, lambda: self._factory(object()))

def test_all_eMM_attribues_exist(self):
def test_all_eMM_attributes_exist(self):
# Issue 12537
eMM = email.message_from_string(_sample_message)
msg = self._factory(_sample_message)
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ def test_pdb_return_command_for_coroutine():

def test_pdb_until_command_for_generator():
"""Testing no unwindng stack on yield for generators
for "until" command if target breakpoing is not reached
for "until" command if target breakpoint is not reached
>>> def test_gen():
... yield 0
Expand Down Expand Up @@ -1027,7 +1027,7 @@ def test_pdb_until_command_for_generator():

def test_pdb_until_command_for_coroutine():
"""Testing no unwindng stack for coroutines
for "until" command if target breakpoing is not reached
for "until" command if target breakpoint is not reached
>>> import asyncio
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_pprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def test_set_of_sets_reprs(self):
# Consequently, this test is fragile and
# implementation-dependent. Small changes to Python's sort
# algorithm cause the test to fail when it should pass.
# XXX Or changes to the dictionary implmentation...
# XXX Or changes to the dictionary implementation...

cube_repr_tgt = """\
{frozenset(): frozenset({frozenset({2}), frozenset({0}), frozenset({1})}),
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ def test_run_kwargs(self):
def test_run_with_pathlike_path(self):
# bpo-31961: test run(pathlike_object)
# the name of a command that can be run without
# any argumenets that exit fast
# any arguments that exit fast
prog = 'tree.com' if mswindows else 'ls'
path = shutil.which(prog)
if path is None:
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def fail_new_thread(*args):
finally:
threading._start_new_thread = _start_new_thread

def test_finalize_runnning_thread(self):
def test_finalize_running_thread(self):
# Issue 1402: the PyGILState_Ensure / _Release functions may be called
# very late on python exit: on deallocation of a running thread for
# example.
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_trace_list_comprehension(self):
firstlineno_called = get_firstlineno(traced_doubler)
expected = {
(self.my_py_filename, firstlineno_calling + 1): 1,
# List compehentions work differently in 3.x, so the count
# List comprehensions work differently in 3.x, so the count
# below changed compared to 2.x.
(self.my_py_filename, firstlineno_calling + 2): 12,
(self.my_py_filename, firstlineno_calling + 3): 1,
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_turtle.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def test_config_dict(self):

self.assertEqual(parsed_cfg, expected)

def test_partial_config_dict_with_commments(self):
def test_partial_config_dict_with_comments(self):

cfg_name = self.get_cfg_file(test_config_two)
parsed_cfg = turtle.config_dict(cfg_name)
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ def test(f, format_spec, result):

# No format code means use g, but must have a decimal
# and a number after the decimal. This is tricky, because
# a totaly empty format specifier means something else.
# a totally empty format specifier means something else.
# So, just use a sign flag
test(1e200, '+g', '+1e+200')
test(1e200, '+', '+1e+200')
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def test_multiprocessing(self):
"""
Test that the multiprocessing is able to spawn.
"""
# Issue bpo-36342: Instanciation of a Pool object imports the
# Issue bpo-36342: Instantiation of a Pool object imports the
# multiprocessing.synchronize module. Skip the test if this module
# cannot be imported.
import_module('multiprocessing.synchronize')
Expand Down
2 changes: 1 addition & 1 deletion Lib/unittest/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def wasSuccessful(self):
"""Tells whether or not this result was a success."""
# The hasattr check is for test_result's OldResult test. That
# way this method works on objects that lack the attribute.
# (where would such result intances come from? old stored pickles?)
# (where would such result instances come from? old stored pickles?)
return ((len(self.failures) == len(self.errors) == 0) and
(not hasattr(self, 'unexpectedSuccesses') or
len(self.unexpectedSuccesses) == 0))
Expand Down
2 changes: 1 addition & 1 deletion Lib/unittest/test/testmock/testmock.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def test_call(self):

ret_val = mock(sentinel.Arg)
self.assertTrue(mock.called, "called not set")
self.assertEqual(mock.call_count, 1, "call_count incoreect")
self.assertEqual(mock.call_count, 1, "call_count incorrect")
self.assertEqual(mock.call_args, ((sentinel.Arg,), {}),
"call_args not set")
self.assertEqual(mock.call_args.args, (sentinel.Arg,),
Expand Down
2 changes: 1 addition & 1 deletion Misc/HISTORY
Original file line number Diff line number Diff line change
Expand Up @@ -2113,7 +2113,7 @@ Build
- Issue #21285: Refactor and fix curses configure check to always search
in a ncursesw directory.

- Issue #15234: For BerkelyDB and Sqlite, only add the found library and
- Issue #15234: For BerkeleyDB and Sqlite, only add the found library and
include directories if they aren't already being searched. This avoids
an explicit runtime library dependency.

Expand Down
2 changes: 1 addition & 1 deletion Misc/NEWS.d/3.5.0a1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4992,7 +4992,7 @@ directory.
.. nonce: vlM720
.. section: Build

For BerkelyDB and Sqlite, only add the found library and include directories
For BerkeleyDB and Sqlite, only add the found library and include directories
if they aren't already being searched. This avoids an explicit runtime
library dependency.

Expand Down
2 changes: 1 addition & 1 deletion Misc/NEWS.d/3.7.0a1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3067,7 +3067,7 @@ Sped up reading encrypted ZIP files by 2 times.
.. section: Library

Element.getiterator() and the html parameter of XMLParser() were deprecated
only in the documentation (since Python 3.2 and 3.4 correspondintly). Now
only in the documentation (since Python 3.2 and 3.4 correspondingly). Now
using them emits a deprecation warning.

..
Expand Down
2 changes: 1 addition & 1 deletion Misc/NEWS.d/3.8.0a1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2054,7 +2054,7 @@ Speed-up building enums by value, e.g. http.HTTPStatus(200).
.. section: Library

random.gammavariate(1.0, beta) now computes the same result as
random.expovariate(1.0 / beta). This synchonizes the two algorithms and
random.expovariate(1.0 / beta). This synchronizes the two algorithms and
eliminates some idiosyncrasies in the old implementation. It does however
produce a difference stream of random variables than it used to.

Expand Down
2 changes: 1 addition & 1 deletion Misc/NEWS.d/3.8.0a4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ only enabled by ``--findleaks``. The check now also works with
.. nonce: B8-ghi
.. section: Tests

When using mulitprocessing mode (-jN), regrtest now better reports errors if
When using multiprocessing mode (-jN), regrtest now better reports errors if
a worker process fails, and it exits immediately on a worker thread failure
or when interrupted.

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Remove errorneous optimization for empty set differences.
Remove erroneous optimization for empty set differences.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Adjust "Zoom Height" to individual screens by momemtarily maximizing the
Adjust "Zoom Height" to individual screens by momentarily maximizing the
window on first use with a particular screen. Changing screen settings
may invalidate the saved height. While a window is maximized,
"Zoom Height" has no effect.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Fix an inifite loop when parsing specially crafted email headers. Patch by
Fix an infinite loop when parsing specially crafted email headers. Patch by
Abhilash Raj.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
``test_venv.test_mutiprocessing()`` now explicitly calls
``test_venv.test_multiprocessing()`` now explicitly calls
``pool.terminate()`` to wait until the pool completes.
Loading

0 comments on commit c4cacc8

Please sign in to comment.