Issue #27895: Spelling fixes (Contributed by Ville Skyttä). · python/cpython@15f44ab (original) (raw)

72 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -1842,7 +1842,7 @@ Note that the :class:`datetime` instances that differ only by the value of the
1842 1842 :attr:`~datetime.fold` attribute are considered equal in comparisons.
1843 1843
1844 1844 Applications that can't bear wall-time ambiguities should explicitly check the
1845 -value of the :attr:`~datetime.fold` atribute or avoid using hybrid
1845 +value of the :attr:`~datetime.fold` attribute or avoid using hybrid
1846 1846 :class:`tzinfo` subclasses; there are no ambiguities when using :class:`timezone`,
1847 1847 or any other fixed-offset :class:`tzinfo` subclass (such as a class representing
1848 1848 only EST (fixed offset -5 hours), or only EDT (fixed offset -4 hours)).
Original file line number Diff line number Diff line change
@@ -433,5 +433,5 @@ Currently the email package provides only one concrete content manager,
433 433
434 434 If *headers* is specified and is a list of strings of the form
435 435 ``headername: headervalue`` or a list of ``header`` objects
436 - (distinguised from strings by having a ``name`` attribute), add the
436 + (distinguished from strings by having a ``name`` attribute), add the
437 437 headers to *msg*.
Original file line number Diff line number Diff line change
@@ -531,7 +531,7 @@ Command line usage
531 531 -c command run command in the shell window
532 532 -d enable debugger and open shell window
533 533 -e open editor window
534 - -h print help message with legal combinatios and exit
534 + -h print help message with legal combinations and exit
535 535 -i open shell window
536 536 -r file run file in shell window
537 537 -s run IDLESTARTUPorIDLESTARTUP or IDLESTARTUPorPYTHONSTARTUP first, in shell window
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ SMTPServer Objects
44 44 dictionary is a suitable value). If not specified the :mod:`asyncore`
45 45 global socket map is used.
46 46
47 - *enable_SMTPUTF8* determins whether the ``SMTPUTF8`` extension (as defined
47 + *enable_SMTPUTF8* determines whether the ``SMTPUTF8`` extension (as defined
48 48 in :RFC:`6531`) should be enabled. The default is ``False``.
49 49 When ``True``, ``SMTPUTF8`` is accepted as a parameter to the ``MAIL``
50 50 command and when present is passed to :meth:`process_message` in the
@@ -162,7 +162,7 @@ SMTPChannel Objects
162 162 accepted in a ``DATA`` command. A value of ``None`` or ``0`` means no
163 163 limit.
164 164
165 - *enable_SMTPUTF8* determins whether the ``SMTPUTF8`` extension (as defined
165 + *enable_SMTPUTF8* determines whether the ``SMTPUTF8`` extension (as defined
166 166 in :RFC:`6531`) should be enabled. The default is ``False``.
167 167 *decode_data* and *enable_SMTPUTF8* cannot be set to ``True`` at the same
168 168 time.
Original file line number Diff line number Diff line change
@@ -1954,7 +1954,7 @@ ssl
1954 1954 :attr:`~ssl.OP_NO_COMPRESSION` can be used to disable compression.
1955 1955 (Contributed by Antoine Pitrou in :issue:`13634`.)
1956 1956
1957 -* Support has been added for the Next Procotol Negotiation extension using
1957 +* Support has been added for the Next Protocol Negotiation extension using
1958 1958 the :meth:`ssl.SSLContext.set_npn_protocols` method.
1959 1959 (Contributed by Colin Marc in :issue:`14204`.)
1960 1960
Original file line number Diff line number Diff line change
@@ -487,7 +487,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
487 487 /* old buffer API
488 488 FIXME: usage of these should all be replaced in Python itself
489 489 but for backwards compatibility we will implement them.
490 - Their usage without a corresponding "unlock" mechansim
490 + Their usage without a corresponding "unlock" mechanism
491 491 may create issues (but they would already be there). */
492 492
493 493 PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject *obj,
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ PyAPI_FUNC(Py_ssize_t) _PyBytes_InsertThousandsGrouping(char *buffer,
131 131 #define F_ZERO (1<<4)
132 132
133 133 #ifndef Py_LIMITED_API
134 -/* The _PyBytesWriter structure is big: it contains an embeded "stack buffer".
134 +/* The _PyBytesWriter structure is big: it contains an embedded "stack buffer".
135 135 A _PyBytesWriter variable must be declared at the end of variables in a
136 136 function to optimize the memory allocation on the stack. */
137 137 typedef struct {
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ extern double pow(double, double);
37 37 #endif /* __STDC__ */
38 38 #endif /* _MSC_VER */
39 39
40 -/* High precision defintion of pi and e (Euler)
40 +/* High precision definition of pi and e (Euler)
41 41 * The values are taken from libc6's math.h.
42 42 */
43 43 #ifndef Py_MATH_PIl
Original file line number Diff line number Diff line change
@@ -590,7 +590,7 @@ def read(self, n=-1):
590 590 bytes. If the EOF was received and the internal buffer is empty, return
591 591 an empty bytes object.
592 592
593 - If n is zero, return empty bytes object immediatelly.
593 + If n is zero, return empty bytes object immediately.
594 594
595 595 If n is positive, this function try to read `n` bytes, and may return
596 596 less or equal bytes than requested, but at least one byte. If EOF was
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@
63 63 # interpreter to exit when there are still idle processes in a
64 64 # ProcessPoolExecutor's process pool (i.e. shutdown() was not called). However,
65 65 # allowing workers to die with the interpreter has two undesirable properties:
66 -# - The workers would still be running during interpretor shutdown,
66 +# - The workers would still be running during interpreter shutdown,
67 67 # meaning that they would fail in unpredictable ways.
68 68 # - The workers could be killed while evaluating a work item, which could
69 69 # be bad if the callable being evaluated has external side-effects e.g.
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
16 16 # to exit when there are still idle threads in a ThreadPoolExecutor's thread
17 17 # pool (i.e. shutdown() was not called). However, allowing workers to die with
18 18 # the interpreter has two undesirable properties:
19 -# - The workers would still be running during interpretor shutdown,
19 +# - The workers would still be running during interpreter shutdown,
20 20 # meaning that they would fail in unpredictable ways.
21 21 # - The workers could be killed while evaluating a work item, which could
22 22 # be bad if the callable being evaluated has external side-effects e.g.
Original file line number Diff line number Diff line change
@@ -125,7 +125,7 @@ def test_reg_class(self):
125 125 self.assertRaises(KeyError, Reg.get_value, 'xxx', 'xxx')
126 126
127 127 # looking for values that should exist on all
128 -# windows registeries versions.
128 +# windows registry versions.
129 129 path = r'Control Panel\Desktop'
130 130 v = Reg.get_value(path, 'dragfullwindows')
131 131 self.assertIn(v, ('0', '1', '2'))
Original file line number Diff line number Diff line change
@@ -141,7 +141,7 @@ def _encode_base64(data, max_line_length):
141 141 def _encode_text(string, charset, cte, policy):
142 142 lines = string.encode(charset).splitlines()
143 143 linesep = policy.linesep.encode('ascii')
144 -def embeded_body(lines): return linesep.join(lines) + linesep
144 +def embedded_body(lines): return linesep.join(lines) + linesep
145 145 def normal_body(lines): return b'\n'.join(lines) + b'\n'
146 146 if cte==None:
147 147 # Use heuristics to decide on the "best" encoding.
@@ -152,7 +152,7 @@ def normal_body(lines): return b'\n'.join(lines) + b'\n'
152 152 if (policy.cte_type == '8bit' and
153 153 max(len(x) for x in lines) <= policy.max_line_length):
154 154 return '8bit', normal_body(lines).decode('ascii', 'surrogateescape')
155 -sniff = embeded_body(lines[:10])
155 +sniff = embedded_body(lines[:10])
156 156 sniff_qp = quoprimime.body_encode(sniff.decode('latin-1'),
157 157 policy.max_line_length)
158 158 sniff_base64 = binascii.b2a_base64(sniff)
@@ -171,7 +171,7 @@ def normal_body(lines): return b'\n'.join(lines) + b'\n'
171 171 data = quoprimime.body_encode(normal_body(lines).decode('latin-1'),
172 172 policy.max_line_length)
173 173 elif cte == 'base64':
174 -data = _encode_base64(embeded_body(lines), policy.max_line_length)
174 +data = _encode_base64(embedded_body(lines), policy.max_line_length)
175 175 else:
176 176 raise ValueError("Unknown content transfer encoding {}".format(cte))
177 177 return cte, data
Original file line number Diff line number Diff line change
@@ -97,7 +97,7 @@ def flatten(self, msg, unixfrom=False, linesep=None):
97 97 self._NL = policy.linesep
98 98 self._encoded_NL = self._encode(self._NL)
99 99 self._EMPTY = ''
100 -self._encoded_EMTPY = self._encode('')
100 +self._encoded_EMPTY = self._encode('')
101 101 # Because we use clone (below) when we recursively process message
102 102 # subparts, and because clone uses the computed policy (not None),
103 103 # submessages will automatically get set to the computed policy when
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@
49 49
50 50 # Find a header embedded in a putative header value. Used to check for
51 51 # header injection attack.
52 -_embeded_header = re.compile(r'\n[^ \t]+:')
52 +_embedded_header = re.compile(r'\n[^ \t]+:')
53 53
54 54
55 55
@@ -385,7 +385,7 @@ def encode(self, splitchars=';, \t', maxlinelen=None, linesep='\n'):
385 385 if self._chunks:
386 386 formatter.add_transition()
387 387 value = formatter._str(linesep)
388 -if _embeded_header.search(value):
388 +if _embedded_header.search(value):
389 389 raise HeaderParseError("header value appears to contain "
390 390 "an embedded header: {!r}".format(value))
391 391 return value
Original file line number Diff line number Diff line change
@@ -1043,7 +1043,7 @@ def iter_attachments(self):
1043 1043 yield from parts
1044 1044 return
1045 1045 # Otherwise we more or less invert the remaining logic in get_body.
1046 -# This only really works in edge cases (ex: non-text relateds or
1046 +# This only really works in edge cases (ex: non-text related or
1047 1047 # alternatives) if the sending agent sets content-disposition.
1048 1048 seen = [] # Only skip the first example of each candidate type.
1049 1049 for part in parts:
Original file line number Diff line number Diff line change
@@ -136,7 +136,7 @@
136 136 #
137 137 # VCHAR defined in http://tools.ietf.org/html/rfc5234#appendix-B.1
138 138
139 -# the patterns for both name and value are more leniant than RFC
139 +# the patterns for both name and value are more lenient than RFC
140 140 # definitions to allow for backwards compatibility
141 141 _is_legal_header_name = re.compile(rb'[^:\s][^:\r\n]*').fullmatch
142 142 _is_illegal_header_value = re.compile(rb'\n(?![ \t])|\r(?![ \t\n])').search
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ pathbrowser.py # Create path browser window.
65 65 percolator.py # Manage delegator stack (nim).
66 66 pyparse.py # Give information on code indentation
67 67 pyshell.py # Start IDLE, manage shell, complete editor window
68 -query.py # Query user for informtion
68 +query.py # Query user for information
69 69 redirector.py # Intercept widget subcommands (for percolator) (nim).
70 70 replace.py # Search and replace pattern in text.
71 71 rpc.py # Commuicate between idle and user processes (nim).
Original file line number Diff line number Diff line change
@@ -497,7 +497,7 @@

25.5.3.1. Command line usage<a class="headerlink" href="#command-line-usage"

497 497 -c command run command in the shell window
498 498 -d enable debugger and open shell window
499 499 -e open editor window
500 --h print help message with legal combinatios and exit
500 +-h print help message with legal combinations and exit
501 501 -i open shell window
502 502 -r file run file in shell window
503 503 -s run IDLESTARTUPorIDLESTARTUP or IDLESTARTUPorPYTHONSTARTUP first, in shell window
Original file line number Diff line number Diff line change
@@ -159,7 +159,7 @@ def test_find_paragraph(self):
159 159 class ReformatFunctionTest(unittest.TestCase):
160 160 """Test the reformat_paragraph function without the editor window."""
161 161
162 -def test_reformat_paragrah(self):
162 +def test_reformat_paragraph(self):
163 163 Equal = self.assertEqual
164 164 reform = fp.reformat_paragraph
165 165 hw = "O hello world"
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ class ReadError(OSError):
64 64
65 65 class RegistryError(Exception):
66 66 """Raised when a registry operation with the archiving
67 - and unpacking registeries fails"""
67 + and unpacking registries fails"""
68 68
69 69
70 70 def copyfileobj(fsrc, fdst, length=16*1024):
Original file line number Diff line number Diff line change
@@ -454,7 +454,7 @@ def bignum_nroot(x, n):
454 454 """Return the nth root of a positive huge number."""
455 455 assert x > 0
456 456 # I state without proof that ⁿ√x ≈ ⁿ√2·ⁿ√(x//2)
457 -# and that for sufficiently big x the error is acceptible.
457 +# and that for sufficiently big x the error is acceptable.
458 458 # We now halve x until it is small enough to get the root.
459 459 m = 0
460 460 while True:
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
26 26 _multiprocessing = test.support.import_module('_multiprocessing')
27 27 # Skip tests if sem_open implementation is broken.
28 28 test.support.import_module('multiprocessing.synchronize')
29 -# import threading after _multiprocessing to raise a more revelant error
29 +# import threading after _multiprocessing to raise a more relevant error
30 30 # message: "No module named _multiprocessing". _multiprocessing is not compiled
31 31 # without thread support.
32 32 import threading
Original file line number Diff line number Diff line change
@@ -3958,7 +3958,7 @@ def test_bug_1028306(self):
3958 3958 self.assertRaises(TypeError, lambda: as_date >= as_datetime)
3959 3959 self.assertRaises(TypeError, lambda: as_datetime >= as_date)
3960 3960
3961 -# Neverthelss, comparison should work with the base-class (date)
3961 +# Nevertheless, comparison should work with the base-class (date)
3962 3962 # projection if use of a date method is forced.
3963 3963 self.assertEqual(as_date.__eq__(as_datetime), True)
3964 3964 different_day = (as_date.day + 1) % 20 + 1
Original file line number Diff line number Diff line change
@@ -130,8 +130,8 @@ def test_acquire_cancel(self):
130 130 def test_cancel_race(self):
131 131 # Several tasks:
132 132 # - A acquires the lock
133 -# - B is blocked in aqcuire()
134 -# - C is blocked in aqcuire()
133 +# - B is blocked in acquire()
134 +# - C is blocked in acquire()
135 135 #
136 136 # Now, concurrently:
137 137 # - B is cancelled
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
4 4 test.support.import_module('_multiprocessing')
5 5 # Skip tests if sem_open implementation is broken.
6 6 test.support.import_module('multiprocessing.synchronize')
7 -# import threading after _multiprocessing to raise a more revelant error
7 +# import threading after _multiprocessing to raise a more relevant error
8 8 # message: "No module named _multiprocessing". _multiprocessing is not compiled
9 9 # without thread support.
10 10 test.support.import_module('threading')
Original file line number Diff line number Diff line change
@@ -876,7 +876,7 @@ def foo(self):
876 876 self.assertEqual(Frag().__int__(), 42)
877 877 self.assertEqual(int(Frag()), 42)
878 878
879 -def test_diamond_inheritence(self):
879 +def test_diamond_inheritance(self):
880 880 # Testing multiple inheritance special cases...
881 881 class A(object):
882 882 def spam(self): return "A"
Original file line number Diff line number Diff line change
@@ -122,17 +122,17 @@ def test_added_tab_hint(self):
122 122 """
123 123
124 124 patch914575_from2 = """
125 -\t\tLine 1: preceeded by from:[tt] to:[ssss]
126 - \t\tLine 2: preceeded by from:[sstt] to:[sssst]
127 - \t \tLine 3: preceeded by from:[sstst] to:[ssssss]
125 +\t\tLine 1: preceded by from:[tt] to:[ssss]
126 + \t\tLine 2: preceded by from:[sstt] to:[sssst]
127 + \t \tLine 3: preceded by from:[sstst] to:[ssssss]
128 128 Line 4: \thas from:[sst] to:[sss] after :
129 129 Line 5: has from:[t] to:[ss] at end\t
130 130 """
131 131
132 132 patch914575_to2 = """
133 - Line 1: preceeded by from:[tt] to:[ssss]
134 - \tLine 2: preceeded by from:[sstt] to:[sssst]
135 - Line 3: preceeded by from:[sstst] to:[ssssss]
133 + Line 1: preceded by from:[tt] to:[ssss]
134 + \tLine 2: preceded by from:[sstt] to:[sssst]
135 + Line 3: preceded by from:[sstst] to:[ssssss]
136 136 Line 4: has from:[sst] to:[sss] after :
137 137 Line 5: has from:[t] to:[ss] at end
138 138 """