bpo-36766: Typos in docs and code comments (GH-13116)

This commit is contained in:
penguindustin 2019-05-06 14:57:17 -04:00 committed by Stéphane Wirtel
parent 3921b1cc34
commit 9646630895
22 changed files with 22 additions and 22 deletions

View File

@ -188,7 +188,7 @@ to be using :class:`BytesGenerator`, and not :class:`Generator`.
(This is required because strings cannot represent non-ASCII bytes.) (This is required because strings cannot represent non-ASCII bytes.)
Convert any bytes with the high bit set as needed using an Convert any bytes with the high bit set as needed using an
ASCII-compatible :mailheader:`Content-Transfer-Encoding`. That is, ASCII-compatible :mailheader:`Content-Transfer-Encoding`. That is,
transform parts with non-ASCII :mailheader:`Cotnent-Transfer-Encoding` transform parts with non-ASCII :mailheader:`Content-Transfer-Encoding`
(:mailheader:`Content-Transfer-Encoding: 8bit`) to an ASCII compatible (:mailheader:`Content-Transfer-Encoding: 8bit`) to an ASCII compatible
:mailheader:`Content-Transfer-Encoding`, and encode RFC-invalid non-ASCII :mailheader:`Content-Transfer-Encoding`, and encode RFC-invalid non-ASCII
bytes in headers using the MIME ``unknown-8bit`` character set, thus bytes in headers using the MIME ``unknown-8bit`` character set, thus

View File

@ -44,7 +44,7 @@ modules.
.. versionadded:: 3.7 .. versionadded:: 3.7
Descriptors for nested definitions. They are accessed through the Descriptors for nested definitions. They are accessed through the
new children attibute. Each has a new parent attribute. new children attribute. Each has a new parent attribute.
The descriptors returned by these functions are instances of The descriptors returned by these functions are instances of
Function and Class classes. Users are not expected to create instances Function and Class classes. Users are not expected to create instances

View File

@ -2225,7 +2225,7 @@ def detach(self):
'General': ''' 'General': '''
General: General:
AutoComplete: Popupwait is milleseconds to wait after key char, without AutoComplete: Popupwait is milliseconds to wait after key char, without
cursor movement, before popping up completion box. Key char is '.' after cursor movement, before popping up completion box. Key char is '.' after
identifier or a '/' (or '\\' on Windows) within a string. identifier or a '/' (or '\\' on Windows) within a string.

View File

@ -721,7 +721,7 @@ <h3>Developing tkinter applications<a class="headerlink" href="#developing-tkint
<span class="pre">root</span> <span class="pre">=</span> <span class="pre">tk.Tk()</span></code> in standard Python and nothing appears. Enter the same <span class="pre">root</span> <span class="pre">=</span> <span class="pre">tk.Tk()</span></code> in standard Python and nothing appears. Enter the same
in IDLE and a tk window appears. In standard Python, one must also enter in IDLE and a tk window appears. In standard Python, one must also enter
<code class="docutils literal notranslate"><span class="pre">root.update()</span></code> to see the window. IDLE does the equivalent in the <code class="docutils literal notranslate"><span class="pre">root.update()</span></code> to see the window. IDLE does the equivalent in the
background, about 20 times a second, which is about every 50 milleseconds. background, about 20 times a second, which is about every 50 milliseconds.
Next enter <code class="docutils literal notranslate"><span class="pre">b</span> <span class="pre">=</span> <span class="pre">tk.Button(root,</span> <span class="pre">text='button');</span> <span class="pre">b.pack()</span></code>. Again, Next enter <code class="docutils literal notranslate"><span class="pre">b</span> <span class="pre">=</span> <span class="pre">tk.Button(root,</span> <span class="pre">text='button');</span> <span class="pre">b.pack()</span></code>. Again,
nothing visibly changes in standard Python until one enters <code class="docutils literal notranslate"><span class="pre">root.update()</span></code>.</p> nothing visibly changes in standard Python until one enters <code class="docutils literal notranslate"><span class="pre">root.update()</span></code>.</p>
<p>Most tkinter programs run <code class="docutils literal notranslate"><span class="pre">root.mainloop()</span></code>, which usually does not <p>Most tkinter programs run <code class="docutils literal notranslate"><span class="pre">root.mainloop()</span></code>, which usually does not

View File

@ -2,7 +2,7 @@
Contents are subject to revision at any time, without notice. Contents are subject to revision at any time, without notice.
Help => About IDLE: diplay About Idle dialog Help => About IDLE: display About Idle dialog
<to be moved here from help_about.py> <to be moved here from help_about.py>

View File

@ -521,7 +521,7 @@ def test_get_current_keyset(self):
def test_get_keyset(self): def test_get_keyset(self):
conf = self.mock_config() conf = self.mock_config()
# Conflic with key set, should be disable to '' # Conflict with key set, should be disable to ''
conf.defaultCfg['extensions'].add_section('Foobar') conf.defaultCfg['extensions'].add_section('Foobar')
conf.defaultCfg['extensions'].add_section('Foobar_cfgBindings') conf.defaultCfg['extensions'].add_section('Foobar_cfgBindings')
conf.defaultCfg['extensions'].set('Foobar', 'enable', 'True') conf.defaultCfg['extensions'].set('Foobar', 'enable', 'True')

View File

@ -321,7 +321,7 @@ def untokenize(iterable):
Round-trip invariant for full input: Round-trip invariant for full input:
Untokenized source will match input source exactly Untokenized source will match input source exactly
Round-trip invariant for limited intput: Round-trip invariant for limited input:
# Output text will tokenize the back to the input # Output text will tokenize the back to the input
t1 = [tok[:2] for tok in generate_tokens(f.readline)] t1 = [tok[:2] for tok in generate_tokens(f.readline)]
newcode = untokenize(t1) newcode = untokenize(t1)

View File

@ -59,7 +59,7 @@ def detach(self):
class _ResourceSharer(object): class _ResourceSharer(object):
'''Manager for resouces using background thread.''' '''Manager for resources using background thread.'''
def __init__(self): def __init__(self):
self._key = 0 self._key = 0
self._cache = {} self._cache = {}

View File

@ -34,7 +34,7 @@
# Internals # Internals
# #
# EBADF - guard agains macOS `stat` throwing EBADF # EBADF - guard against macOS `stat` throwing EBADF
_IGNORED_ERROS = (ENOENT, ENOTDIR, EBADF) _IGNORED_ERROS = (ENOENT, ENOTDIR, EBADF)
_IGNORED_WINERRORS = ( _IGNORED_WINERRORS = (

View File

@ -72,7 +72,7 @@
# type information # type information
# 0.4.0 - added win32_ver() and modified the platform() output for WinXX # 0.4.0 - added win32_ver() and modified the platform() output for WinXX
# 0.3.4 - fixed a bug in _follow_symlinks() # 0.3.4 - fixed a bug in _follow_symlinks()
# 0.3.3 - fixed popen() and "file" command invokation bugs # 0.3.3 - fixed popen() and "file" command invocation bugs
# 0.3.2 - added architecture() API and support for it in platform() # 0.3.2 - added architecture() API and support for it in platform()
# 0.3.1 - fixed syscmd_ver() RE to support Windows NT # 0.3.1 - fixed syscmd_ver() RE to support Windows NT
# 0.3.0 - added system alias support # 0.3.0 - added system alias support

View File

@ -509,7 +509,7 @@ def func_std_string(func_name): # match what old profile produced
return "%s:%d(%s)" % func_name return "%s:%d(%s)" % func_name
#************************************************************************** #**************************************************************************
# The following functions combine statists for pairs functions. # The following functions combine statistics for pairs functions.
# The bulk of the processing involves correctly handling "call" lists, # The bulk of the processing involves correctly handling "call" lists,
# such as callers and callees. # such as callers and callees.
#************************************************************************** #**************************************************************************

View File

@ -3483,7 +3483,7 @@ def utcoffset(self, t):
self.assertEqual(got, expected) self.assertEqual(got, expected)
# However, if they're different members, uctoffset is not ignored. # However, if they're different members, uctoffset is not ignored.
# Note that a time can't actually have an operand-depedent offset, # Note that a time can't actually have an operand-dependent offset,
# though (and time.utcoffset() passes None to tzinfo.utcoffset()), # though (and time.utcoffset() passes None to tzinfo.utcoffset()),
# so skip this test for time. # so skip this test for time.
if cls is not time: if cls is not time:

View File

@ -2222,7 +2222,7 @@ def remove_frames(pickled, keep_frame=None):
frame_size = self.FRAME_SIZE_TARGET frame_size = self.FRAME_SIZE_TARGET
num_frames = 20 num_frames = 20
# Large byte objects (dict values) intermitted with small objects # Large byte objects (dict values) intermittent with small objects
# (dict keys) # (dict keys)
obj = {i: bytes([i]) * frame_size for i in range(num_frames)} obj = {i: bytes([i]) * frame_size for i in range(num_frames)}

View File

@ -1006,7 +1006,7 @@ def temp_dir(path=None, quiet=False):
yield path yield path
finally: finally:
# In case the process forks, let only the parent remove the # In case the process forks, let only the parent remove the
# directory. The child has a diffent process id. (bpo-30028) # directory. The child has a different process id. (bpo-30028)
if dir_created and pid == os.getpid(): if dir_created and pid == os.getpid():
rmtree(path) rmtree(path)

View File

@ -1458,7 +1458,7 @@ class C:
} }
) )
# Make sure that the returned dicts are actuall OrderedDicts. # Make sure that the returned dicts are actually OrderedDicts.
self.assertIs(type(d), OrderedDict) self.assertIs(type(d), OrderedDict)
self.assertIs(type(d['y'][1]), OrderedDict) self.assertIs(type(d['y'][1]), OrderedDict)

View File

@ -56,7 +56,7 @@ class LazyLoaderTests(unittest.TestCase):
def test_init(self): def test_init(self):
with self.assertRaises(TypeError): with self.assertRaises(TypeError):
# Classes that dono't define exec_module() trigger TypeError. # Classes that don't define exec_module() trigger TypeError.
util.LazyLoader(object) util.LazyLoader(object)
def new_module(self, source_code=None): def new_module(self, source_code=None):

View File

@ -719,7 +719,7 @@ def test_choices_algorithms(self):
c = self.gen.choices(range(n), cum_weights=range(1, n+1), k=10000) c = self.gen.choices(range(n), cum_weights=range(1, n+1), k=10000)
self.assertEqual(a, c) self.assertEqual(a, c)
# Amerian Roulette # American Roulette
population = ['Red', 'Black', 'Green'] population = ['Red', 'Black', 'Green']
weights = [18, 18, 2] weights = [18, 18, 2]
cum_weights = [18, 36, 38] cum_weights = [18, 36, 38]

View File

@ -4332,7 +4332,7 @@ def test_pha_optional_nocert(self):
self.assertEqual(s.recv(1024), b'FALSE\n') self.assertEqual(s.recv(1024), b'FALSE\n')
s.write(b'PHA') s.write(b'PHA')
self.assertEqual(s.recv(1024), b'OK\n') self.assertEqual(s.recv(1024), b'OK\n')
# optional doens't fail when client does not have a cert # optional doesn't fail when client does not have a cert
s.write(b'HASCERT') s.write(b'HASCERT')
self.assertEqual(s.recv(1024), b'FALSE\n') self.assertEqual(s.recv(1024), b'FALSE\n')

View File

@ -211,7 +211,7 @@ def foo3(bar: 'func'=lambda x: x) -> {1: 2}:
self.assertIn('doc3', msgids) self.assertIn('doc3', msgids)
def test_classdocstring_early_colon(self): def test_classdocstring_early_colon(self):
""" Test docstring extraction for a class with colons occuring within """ Test docstring extraction for a class with colons occurring within
the parentheses. the parentheses.
""" """
msgids = self.extract_docstrings_from_str(dedent('''\ msgids = self.extract_docstrings_from_str(dedent('''\

View File

@ -82,7 +82,7 @@ def maybe(*choices): return group(*choices) + '?'
# Return the empty string, plus all of the valid string prefixes. # Return the empty string, plus all of the valid string prefixes.
def _all_string_prefixes(): def _all_string_prefixes():
# The valid string prefixes. Only contain the lower case versions, # The valid string prefixes. Only contain the lower case versions,
# and don't contain any permuations (include 'fr', but not # and don't contain any permutations (include 'fr', but not
# 'rf'). The various permutations will be generated. # 'rf'). The various permutations will be generated.
_valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr'] _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']
# if we add binary f-strings, add: ['fb', 'fbr'] # if we add binary f-strings, add: ['fb', 'fbr']

View File

@ -1568,7 +1568,7 @@ def degrees(self, fullcircle=360.0):
fullcircle - a number fullcircle - a number
Set angle measurement units, i. e. set number Set angle measurement units, i. e. set number
of 'degrees' for a full circle. Dafault value is of 'degrees' for a full circle. Default value is
360 degrees. 360 degrees.
Example (for a Turtle instance named turtle): Example (for a Turtle instance named turtle):

View File

@ -2170,7 +2170,7 @@ _PyObject_AssertFailed(PyObject *obj, const char *expr, const char *msg,
fprintf(stderr, "<object: freed type %p>\n", (void *)Py_TYPE(obj)); fprintf(stderr, "<object: freed type %p>\n", (void *)Py_TYPE(obj));
} }
else { else {
/* Diplay the traceback where the object has been allocated. /* Display the traceback where the object has been allocated.
Do it before dumping repr(obj), since repr() is more likely Do it before dumping repr(obj), since repr() is more likely
to crash than dumping the traceback. */ to crash than dumping the traceback. */
void *ptr; void *ptr;