Skip to content

Commit 28453fe

Browse files
authored
[3.6] bpo-32297: Fix misspellings in Python source code comments (GH-4803) (#4864)
* [3.6] bpo-32297: Few misspellings found in Python source code comments. (GH-4803) * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py. (cherry picked from commit 53f7a7c)
1 parent 645fa19 commit 28453fe

36 files changed

+70
-69
lines changed

Doc/includes/email-read-alternative.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
print('From:', msg['from'])
2222
print('Subject:', msg['subject'])
2323

24-
# If we want to print a priview of the message content, we can extract whatever
24+
# If we want to print a preview of the message content, we can extract whatever
2525
# the least formatted payload is and print the first three lines. Of course,
2626
# if the message has no plain text part printing the first three lines of html
2727
# is probably useless, but this is just a conceptual example.

Lib/ctypes/test/test_pep3118.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class Complete(Structure):
188188
(PackedPoint, "B", (), PackedPoint),
189189
(Point2, "T{<l:x:<l:y:}".replace('l', s_long), (), Point2),
190190
(EmptyStruct, "T{}", (), EmptyStruct),
191-
# the pep does't support unions
191+
# the pep doesn't support unions
192192
(aUnion, "B", (), aUnion),
193193
# structure with sub-arrays
194194
(StructWithArrays, "T{(2,3)<l:x:(4)T{<l:x:<l:y:}:y:}".replace('l', s_long), (), StructWithArrays),

Lib/ctypes/test/test_structures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class XX(Structure):
129129
self.assertEqual(sizeof(XX), 0)
130130

131131
def test_fields(self):
132-
# test the offset and size attributes of Structure/Unoin fields.
132+
# test the offset and size attributes of Structure/Union fields.
133133
class X(Structure):
134134
_fields_ = [("x", c_int),
135135
("y", c_char)]

Lib/email/quoprimime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def body_encode(body, maxlinelen=76, eol=NL):
173173
if not body:
174174
return body
175175

176-
# quote speacial characters
176+
# quote special characters
177177
body = body.translate(_QUOPRI_BODY_ENCODE_MAP)
178178

179179
soft_break = '=' + eol

Lib/http/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ def _get_chunk_left(self):
540540
chunk_left = self.chunk_left
541541
if not chunk_left: # Can be 0 or None
542542
if chunk_left is not None:
543-
# We are at the end of chunk. dicard chunk end
543+
# We are at the end of chunk, discard chunk end
544544
self._safe_read(2) # toss the CRLF at the end of the chunk
545545
try:
546546
chunk_left = self._read_next_chunk_size()

Lib/os.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ def spawnve(mode, file, args, env):
882882
otherwise return -SIG, where SIG is the signal that killed it. """
883883
return _spawnvef(mode, file, args, env, execve)
884884

885-
# Note: spawnvp[e] is't currently supported on Windows
885+
# Note: spawnvp[e] isn't currently supported on Windows
886886

887887
def spawnvp(mode, file, args):
888888
"""spawnvp(mode, file, args) -> integer

Lib/tarfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ def frombuf(cls, buf, encoding, errors):
10561056

10571057
# The old GNU sparse format occupies some of the unused
10581058
# space in the buffer for up to 4 sparse structures.
1059-
# Save the them for later processing in _proc_sparse().
1059+
# Save them for later processing in _proc_sparse().
10601060
if obj.type == GNUTYPE_SPARSE:
10611061
pos = 386
10621062
structs = []

Lib/test/_test_multiprocessing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3896,7 +3896,7 @@ def test_noforkbomb(self):
38963896
#
38973897

38983898
class TestForkAwareThreadLock(unittest.TestCase):
3899-
# We recurisvely start processes. Issue #17555 meant that the
3899+
# We recursively start processes. Issue #17555 meant that the
39003900
# after fork registry would get duplicate entries for the same
39013901
# lock. The size of the registry at generation n was ~2**n.
39023902

Lib/test/test_baseexception.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def test_raise_string(self):
163163
self.raise_fails("spam")
164164

165165
def test_catch_non_BaseException(self):
166-
# Tryinng to catch an object that does not inherit from BaseException
166+
# Trying to catch an object that does not inherit from BaseException
167167
# is not allowed.
168168
class NonBaseException(object):
169169
pass

Lib/test/test_class.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,5 +595,6 @@ class A:
595595
with self.assertRaises(TypeError):
596596
type.__setattr__(A, b'x', None)
597597

598+
598599
if __name__ == '__main__':
599600
unittest.main()

0 commit comments

Comments
 (0)