Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/includes/email-read-alternative.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
print('From:', msg['from'])
print('Subject:', msg['subject'])

# If we want to print a priview of the message content, we can extract whatever
# If we want to print a preview of the message content, we can extract whatever
# the least formatted payload is and print the first three lines. Of course,
# if the message has no plain text part printing the first three lines of html
# is probably useless, but this is just a conceptual example.
Expand Down
2 changes: 1 addition & 1 deletion Lib/ctypes/test/test_pep3118.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class Complete(Structure):
(PackedPoint, "B", (), PackedPoint),
(Point2, "T{<l:x:<l:y:}".replace('l', s_long), (), Point2),
(EmptyStruct, "T{}", (), EmptyStruct),
# the pep does't support unions
# the pep doesn't support unions
(aUnion, "B", (), aUnion),
# structure with sub-arrays
(StructWithArrays, "T{(2,3)<l:x:(4)T{<l:x:<l:y:}:y:}".replace('l', s_long), (), StructWithArrays),
Expand Down
2 changes: 1 addition & 1 deletion Lib/ctypes/test/test_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class XX(Structure):
self.assertEqual(sizeof(XX), 0)

def test_fields(self):
# test the offset and size attributes of Structure/Unoin fields.
# test the offset and size attributes of Structure/Union fields.
class X(Structure):
_fields_ = [("x", c_int),
("y", c_char)]
Expand Down
2 changes: 1 addition & 1 deletion Lib/email/quoprimime.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def body_encode(body, maxlinelen=76, eol=NL):
if not body:
return body

# quote speacial characters
# quote special characters
body = body.translate(_QUOPRI_BODY_ENCODE_MAP)

soft_break = '=' + eol
Expand Down
2 changes: 1 addition & 1 deletion Lib/http/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def _get_chunk_left(self):
chunk_left = self.chunk_left
if not chunk_left: # Can be 0 or None
if chunk_left is not None:
# We are at the end of chunk. dicard chunk end
# We are at the end of chunk, discard chunk end
self._safe_read(2) # toss the CRLF at the end of the chunk
try:
chunk_left = self._read_next_chunk_size()
Expand Down
2 changes: 1 addition & 1 deletion Lib/os.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ def spawnve(mode, file, args, env):
otherwise return -SIG, where SIG is the signal that killed it. """
return _spawnvef(mode, file, args, env, execve)

# Note: spawnvp[e] is't currently supported on Windows
# Note: spawnvp[e] isn't currently supported on Windows

def spawnvp(mode, file, args):
"""spawnvp(mode, file, args) -> integer
Expand Down
2 changes: 1 addition & 1 deletion Lib/tarfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ def frombuf(cls, buf, encoding, errors):

# The old GNU sparse format occupies some of the unused
# space in the buffer for up to 4 sparse structures.
# Save the them for later processing in _proc_sparse().
# Save them for later processing in _proc_sparse().
if obj.type == GNUTYPE_SPARSE:
pos = 386
structs = []
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/_test_multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4115,7 +4115,7 @@ def test_noforkbomb(self):
#

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

Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_baseexception.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def test_raise_string(self):
self.raise_fails("spam")

def test_catch_non_BaseException(self):
# Tryinng to catch an object that does not inherit from BaseException
# Trying to catch an object that does not inherit from BaseException
# is not allowed.
class NonBaseException(object):
pass
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ class C:
with self.assertRaisesRegex(TypeError, r'C\(\).__init__\(\) takes no arguments'):
object.__init__(C(), 42)

# Class with both `__init__` & `__new__` method overriden
# Class with both `__init__` & `__new__` method overridden
class D:
def __new__(cls, *args, **kwargs):
super().__new__(cls, *args, **kwargs)
Expand Down
6 changes: 3 additions & 3 deletions Lib/test/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ def __await__(self):

c = new_coro()
self.assertIsInstance(c, Awaitable)
c.close() # awoid RuntimeWarning that coro() was not awaited
c.close() # avoid RuntimeWarning that coro() was not awaited

class CoroLike: pass
Coroutine.register(CoroLike)
Expand Down Expand Up @@ -608,7 +608,7 @@ def __await__(self):

c = new_coro()
self.assertIsInstance(c, Coroutine)
c.close() # awoid RuntimeWarning that coro() was not awaited
c.close() # avoid RuntimeWarning that coro() was not awaited

class CoroLike:
def send(self, value):
Expand Down Expand Up @@ -1615,7 +1615,7 @@ def test_MutableSequence(self):
'__len__', '__getitem__', '__setitem__', '__delitem__', 'insert')

def test_MutableSequence_mixins(self):
# Test the mixins of MutableSequence by creating a miminal concrete
# Test the mixins of MutableSequence by creating a minimal concrete
# class inherited from it.
class MutableSequenceSubclass(MutableSequence):
def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ def __post_init__(self):
self.assertEqual(C().x, 0)
self.assertEqual(C(2).x, 4)

# Make sure that if we'r frozen, post-init can't set
# Make sure that if we're frozen, post-init can't set
# attributes.
@dataclass(frozen=True)
class C:
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 @@ -420,7 +420,7 @@ def __str__(self):
p.keywords[self] = ['sth2']
return 'astr'

# Raplacing the value during key formatting should keep the original
# Replacing the value during key formatting should keep the original
# value alive (at least long enough).
p.keywords[MutatesYourDict()] = ['sth']
r = repr(p)
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 @@ -1458,7 +1458,7 @@ def remove_from_successors(i0, len=len):
# If we create a square with one exit, we must visit it next;
# else somebody else will have to visit it, and since there's
# only one adjacent, there won't be a way to leave it again.
# Finelly, if we create more than one free square with a
# Finally, if we create more than one free square with a
# single exit, we can only move to one of them next, leaving
# the other one a dead end.
ne0 = ne1 = 0
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_importlib/builtin/test_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_module(self):
# Built-in modules cannot be a package.
test_package = None

# Built-in modules cannobt be in a package.
# Built-in modules cannot be in a package.
test_module_in_package = None

# Built-in modules cannot be a package.
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_importlib/source/test_file_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def test_checked_hash_based_pyc(self):
)

@util.writes_bytecode_files
def test_overriden_checked_hash_based_pyc(self):
def test_overridden_checked_hash_based_pyc(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to change function name for the sake of correct spelling. It shouldn't affect any other code and looks like tests aren't failing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is okay since it won't affect anything else, and test can run as it is.

with util.create_modules('_temp') as mapping, \
unittest.mock.patch('_imp.check_hash_based_pycs', 'never'):
source = mapping['_temp']
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,7 @@ class Foo(object):
foo.__dict__['d'] = 1
self.assertEqual(inspect.getattr_static(foo, 'd'), 1)

# if the descriptor is a data-desciptor we should return the
# if the descriptor is a data-descriptor we should return the
# descriptor
descriptor.__set__ = lambda s, i, v: None
self.assertEqual(inspect.getattr_static(foo, 'd'), Foo.__dict__['d'])
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ def test_raw_bytes_io(self):
self.read_ops(f, True)

def test_large_file_ops(self):
# On Windows and Mac OSX this test comsumes large resources; It takes
# On Windows and Mac OSX this test consumes large resources; It takes
# a long time to build the >2 GiB file and takes >2 GiB of disk space
# therefore the resource must be enabled to run this test.
if sys.platform[:3] == 'win' or sys.platform == 'darwin':
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_largefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def setUpModule():
except (ImportError, AttributeError):
pass

# On Windows and Mac OSX this test comsumes large resources; It
# On Windows and Mac OSX this test consumes large resources; It
# takes a long time to build the >2 GiB file and takes >2 GiB of disk
# space therefore the resource must be enabled to run this test.
# If not, nothing after this line stanza will be executed.
Expand Down
50 changes: 25 additions & 25 deletions Lib/test/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class BuiltinLevelsTest(BaseTest):
"""Test builtin levels and their inheritance."""

def test_flat(self):
#Logging levels in a flat logger namespace.
# Logging levels in a flat logger namespace.
m = self.next_message

ERR = logging.getLogger("ERR")
Expand Down Expand Up @@ -248,7 +248,7 @@ def test_nested_explicit(self):
])

def test_nested_inherited(self):
#Logging levels in a nested namespace, inherited from parent loggers.
# Logging levels in a nested namespace, inherited from parent loggers.
m = self.next_message

INF = logging.getLogger("INF")
Expand Down Expand Up @@ -1913,9 +1913,9 @@ def test_encoding_plain_file(self):

def test_encoding_cyrillic_unicode(self):
log = logging.getLogger("test")
#Get a message in Unicode: Do svidanya in Cyrillic (meaning goodbye)
# Get a message in Unicode: Do svidanya in Cyrillic (meaning goodbye)
message = '\u0434\u043e \u0441\u0432\u0438\u0434\u0430\u043d\u0438\u044f'
#Ensure it's written in a Cyrillic encoding
# Ensure it's written in a Cyrillic encoding
writer_class = codecs.getwriter('cp1251')
writer_class.encoding = 'cp1251'
stream = io.BytesIO()
Expand All @@ -1929,7 +1929,7 @@ def test_encoding_cyrillic_unicode(self):
handler.close()
# check we wrote exactly those bytes, ignoring trailing \n etc
s = stream.getvalue()
#Compare against what the data should be when encoded in CP-1251
# Compare against what the data should be when encoded in CP-1251
self.assertEqual(s, b'\xe4\xee \xf1\xe2\xe8\xe4\xe0\xed\xe8\xff\n')


Expand All @@ -1950,7 +1950,7 @@ def test_warnings(self):
h.close()
self.assertGreater(s.find("UserWarning: I'm warning you...\n"), 0)

#See if an explicit file uses the original implementation
# See if an explicit file uses the original implementation
a_file = io.StringIO()
warnings.showwarning("Explicit", UserWarning, "dummy.py", 42,
a_file, "Dummy line")
Expand Down Expand Up @@ -2091,7 +2091,7 @@ class ConfigDictTest(BaseTest):
},
}

#As config1 but with a misspelt level on a handler
# As config1 but with a misspelt level on a handler
config2a = {
'version': 1,
'formatters': {
Expand Down Expand Up @@ -2119,7 +2119,7 @@ class ConfigDictTest(BaseTest):
}


#As config1 but with a misspelt level on a logger
# As config1 but with a misspelt level on a logger
config2b = {
'version': 1,
'formatters': {
Expand Down Expand Up @@ -2286,8 +2286,8 @@ class ConfigDictTest(BaseTest):
},
}

#config 7 does not define compiler.parser but defines compiler.lexer
#so compiler.parser should be disabled after applying it
# config 7 does not define compiler.parser but defines compiler.lexer
# so compiler.parser should be disabled after applying it
config7 = {
'version': 1,
'formatters': {
Expand Down Expand Up @@ -2432,7 +2432,7 @@ class ConfigDictTest(BaseTest):
},
}

#As config1 but with a filter added
# As config1 but with a filter added
config10 = {
'version': 1,
'formatters': {
Expand Down Expand Up @@ -2466,7 +2466,7 @@ class ConfigDictTest(BaseTest):
},
}

#As config1 but using cfg:// references
# As config1 but using cfg:// references
config11 = {
'version': 1,
'true_formatters': {
Expand Down Expand Up @@ -2497,7 +2497,7 @@ class ConfigDictTest(BaseTest):
},
}

#As config11 but missing the version key
# As config11 but missing the version key
config12 = {
'true_formatters': {
'form1' : {
Expand Down Expand Up @@ -2527,7 +2527,7 @@ class ConfigDictTest(BaseTest):
},
}

#As config11 but using an unsupported version
# As config11 but using an unsupported version
config13 = {
'version': 2,
'true_formatters': {
Expand Down Expand Up @@ -2728,7 +2728,7 @@ def test_config7_ok(self):
# Original logger output is empty.
self.assert_log_lines([])

#Same as test_config_7_ok but don't disable old loggers.
# Same as test_config_7_ok but don't disable old loggers.
def test_config_8_ok(self):
with support.captured_stdout() as output:
self.apply_config(self.config1)
Expand Down Expand Up @@ -2809,15 +2809,15 @@ def test_config_9_ok(self):
with support.captured_stdout() as output:
self.apply_config(self.config9)
logger = logging.getLogger("compiler.parser")
#Nothing will be output since both handler and logger are set to WARNING
# Nothing will be output since both handler and logger are set to WARNING
logger.info(self.next_message())
self.assert_log_lines([], stream=output)
self.apply_config(self.config9a)
#Nothing will be output since both handler is still set to WARNING
# Nothing will be output since handler is still set to WARNING
logger.info(self.next_message())
self.assert_log_lines([], stream=output)
self.apply_config(self.config9b)
#Message should now be output
# Message should now be output
logger.info(self.next_message())
self.assert_log_lines([
('INFO', '3'),
Expand All @@ -2829,13 +2829,13 @@ def test_config_10_ok(self):
logger = logging.getLogger("compiler.parser")
logger.warning(self.next_message())
logger = logging.getLogger('compiler')
#Not output, because filtered
# Not output, because filtered
logger.warning(self.next_message())
logger = logging.getLogger('compiler.lexer')
#Not output, because filtered
# Not output, because filtered
logger.warning(self.next_message())
logger = logging.getLogger("compiler.parser.codegen")
#Output, as not filtered
# Output, as not filtered
logger.error(self.next_message())
self.assert_log_lines([
('WARNING', '1'),
Expand Down Expand Up @@ -2894,13 +2894,13 @@ def test_listen_config_10_ok(self):
logger = logging.getLogger("compiler.parser")
logger.warning(self.next_message())
logger = logging.getLogger('compiler')
#Not output, because filtered
# Not output, because filtered
logger.warning(self.next_message())
logger = logging.getLogger('compiler.lexer')
#Not output, because filtered
# Not output, because filtered
logger.warning(self.next_message())
logger = logging.getLogger("compiler.parser.codegen")
#Output, as not filtered
# Output, as not filtered
logger.error(self.next_message())
self.assert_log_lines([
('WARNING', '1'),
Expand Down Expand Up @@ -4335,7 +4335,7 @@ def test_rollover(self):
break
msg = 'No rotated files found, went back %d seconds' % GO_BACK
if not found:
#print additional diagnostics
# print additional diagnostics
dn, fn = os.path.split(self.fn)
files = [f for f in os.listdir(dn) if f.startswith(fn)]
print('Test time: %s' % now.strftime("%Y-%m-%d %H-%M-%S"), file=sys.stderr)
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,7 @@ def assertIsNaN(self, value):


class IsCloseTests(unittest.TestCase):
isclose = math.isclose # sublcasses should override this
isclose = math.isclose # subclasses should override this

def assertIsClose(self, a, b, *args, **kwargs):
self.assertTrue(self.isclose(a, b, *args, **kwargs),
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def check_expr(self, s):
self.roundtrip(parser.expr, s)

def test_flags_passed(self):
# The unicode literals flags has to be passed from the paser to AST
# The unicode literals flags has to be passed from the parser to AST
# generation.
suite = parser.suite("from __future__ import unicode_literals; x = ''")
code = suite.compile()
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_autoseed(self):
self.gen.seed()
state1 = self.gen.getstate()
time.sleep(0.1)
self.gen.seed() # diffent seeds at different times
self.gen.seed() # different seeds at different times
state2 = self.gen.getstate()
self.assertNotEqual(state1, state2)

Expand Down
Loading