From 7fb7b3307d64b1bd64bdbd02177038c0d4e9bfa6 Mon Sep 17 00:00:00 2001 From: John Zhou Date: Thu, 15 May 2025 21:08:34 -0500 Subject: [PATCH 1/4] A medium-sized batch of typo fixes --- Lib/sysconfig/__init__.py | 2 +- Lib/test/test_asyncio/test_sslproto.py | 2 +- Lib/test/test_capi/test_tuple.py | 2 +- Lib/test/test_capi/test_type.py | 2 +- Lib/test/test_sysconfig.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py index 68890b45b82008..efbed051db7c58 100644 --- a/Lib/sysconfig/__init__.py +++ b/Lib/sysconfig/__init__.py @@ -364,7 +364,7 @@ def _get_sysconfigdata(): def _installation_is_relocated(): - """Is the Python installation running from a different prefix than what was targetted when building?""" + """Is the Python installation running from a different prefix than what was targeted when building?""" if os.name != 'posix': raise NotImplementedError('sysconfig._installation_is_relocated() is currently only supported on POSIX') diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py index aa248c5786f634..452f83a5ecf722 100644 --- a/Lib/test/test_asyncio/test_sslproto.py +++ b/Lib/test/test_asyncio/test_sslproto.py @@ -116,7 +116,7 @@ def test_connection_lost_when_busy(self): sock.fileno = mock.Mock(return_value=12345) sock.send = mock.Mock(side_effect=BrokenPipeError) - # construct StreamWriter chain that contains loop dependant logic this emulates + # construct StreamWriter chain that contains loop dependent logic this emulates # what _make_ssl_transport() does in BaseSelectorEventLoop reader = asyncio.StreamReader(limit=2 ** 16, loop=self.loop) protocol = asyncio.StreamReaderProtocol(reader, loop=self.loop) diff --git a/Lib/test/test_capi/test_tuple.py b/Lib/test/test_capi/test_tuple.py index 7c07bc64e247c5..0eb70ff68f32f5 100644 --- a/Lib/test/test_capi/test_tuple.py +++ b/Lib/test/test_capi/test_tuple.py @@ -259,7 +259,7 @@ def test__tuple_resize(self): def test_bug_59313(self): # Before 3.14, the C-API function PySequence_Tuple # would create incomplete tuples which were visible to - # the cycle GC, and this test would crash the interpeter. + # the cycle GC, and this test would crash the interpreter. TAG = object() tuples = [] diff --git a/Lib/test/test_capi/test_type.py b/Lib/test/test_capi/test_type.py index 3c9974c7387388..0c8abe24a33c0f 100644 --- a/Lib/test/test_capi/test_type.py +++ b/Lib/test/test_capi/test_type.py @@ -259,7 +259,7 @@ class FreezeThis(metaclass=Meta): self.assertEqual(FreezeThis.value, 2) def test_manual_heap_type(self): - # gh-128923: test that a manually allocated and initailized heap type + # gh-128923: test that a manually allocated and initialized heap type # works correctly ManualHeapType = _testcapi.ManualHeapType for i in range(100): diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py index 53e55383bf9c72..307369c170b37a 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -703,7 +703,7 @@ def test_sysconfigdata_json(self): # Keys dependent on uncontrollable external context ignore_keys = {'userbase'} - # Keys dependent on Python being run outside the build directrory + # Keys dependent on Python being run outside the build directory if sysconfig.is_python_build(): ignore_keys |= {'srcdir'} # Keys dependent on the executable location From 331a2f093120245eab046adf48409a8926d812c6 Mon Sep 17 00:00:00 2001 From: John Zhou Date: Thu, 15 May 2025 21:11:51 -0500 Subject: [PATCH 2/4] one more --- Lib/imaplib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/imaplib.py b/Lib/imaplib.py index 2c3925958d011b..e663e55ad6ebc1 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -1524,7 +1524,7 @@ def _pop(self, timeout, default=('', None)): # Historical Note: # The timeout was originally implemented using select() after # checking for the presence of already-buffered data. - # That allowed timeouts on pipe connetions like IMAP4_stream. + # That allowed timeouts on pipe connections like IMAP4_stream. # However, it seemed possible that SSL data arriving without any # IMAP data afterward could cause select() to indicate available # application data when there was none, leading to a read() call From 408cafc8e1dbd884a650ba72556ada8cf95504e4 Mon Sep 17 00:00:00 2001 From: John Zhou Date: Thu, 15 May 2025 21:13:47 -0500 Subject: [PATCH 3/4] sorry, one more --- Lib/test/test_build_details.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_build_details.py b/Lib/test/test_build_details.py index 05ce163a337881..65b61599eb8d00 100644 --- a/Lib/test/test_build_details.py +++ b/Lib/test/test_build_details.py @@ -114,7 +114,7 @@ def contents(self): def test_location(self): self.assertTrue(os.path.isfile(self.location)) - # Override generic format tests with tests for our specific implemenation. + # Override generic format tests with tests for our specific implementation. @needs_installed_python @unittest.skipIf(is_android or is_apple_mobile, 'Android and iOS run tests via a custom testbed method that changes sys.executable') From 1af057a3e174d0474f91227aa7548768f22664a5 Mon Sep 17 00:00:00 2001 From: John Zhou Date: Thu, 15 May 2025 21:19:13 -0500 Subject: [PATCH 4/4] 5 or 6 more --- Lib/multiprocessing/resource_tracker.py | 2 +- Lib/test/test_logging.py | 2 +- Lib/test/test_opcache.py | 2 +- Lib/test/test_pyrepl/test_pyrepl.py | 2 +- Lib/test/test_xml_etree.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Lib/multiprocessing/resource_tracker.py b/Lib/multiprocessing/resource_tracker.py index 05633ac21a259c..14ff2cc927b56b 100644 --- a/Lib/multiprocessing/resource_tracker.py +++ b/Lib/multiprocessing/resource_tracker.py @@ -76,7 +76,7 @@ def _reentrant_call_error(self): "Reentrant call into the multiprocessing resource tracker") def __del__(self): - # making sure child processess are cleaned before ResourceTracker + # making sure child processes are cleaned before ResourceTracker # gets destructed. # see https://github.com/python/cpython/issues/88887 self._stop(use_blocking_lock=False) diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index fa5b1e438168bc..3086f663751c36 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -2387,7 +2387,7 @@ def __getattr__(self, attribute): return getattr(queue, attribute) class CustomQueueFakeProtocol(CustomQueueProtocol): - # An object implementing the minimial Queue API for + # An object implementing the minimal Queue API for # the logging module but with incorrect signatures. # # The object will be considered a valid queue class since we diff --git a/Lib/test/test_opcache.py b/Lib/test/test_opcache.py index a45aafc63fa697..06815af857d3b8 100644 --- a/Lib/test/test_opcache.py +++ b/Lib/test/test_opcache.py @@ -571,7 +571,7 @@ def test(default=None): def make_deferred_ref_count_obj(): """Create an object that uses deferred reference counting. - Only objects that use deferred refence counting may be stored in inline + Only objects that use deferred reference counting may be stored in inline caches in free-threaded builds. This constructs a new class named Foo, which uses deferred reference counting. """ diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py index fc8114891d12dd..5b91434a61f20a 100644 --- a/Lib/test/test_pyrepl/test_pyrepl.py +++ b/Lib/test/test_pyrepl/test_pyrepl.py @@ -934,7 +934,7 @@ def test_import_completions(self): # Make iter_modules() search only the standard library. # This makes the test more reliable in case there are # other user packages/scripts on PYTHONPATH which can - # intefere with the completions. + # interfere with the completions. lib_path = os.path.dirname(importlib.__path__[0]) sys.path = [lib_path] diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index 8f2779520070d2..54cfae451ebf06 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -2710,7 +2710,7 @@ def test_remove_with_clear_assume_existing(self): def do_test_remove_with_clear(self, *, raises): - # Until the discrepency between "del root[:]" and "root.clear()" is + # Until the discrepancy between "del root[:]" and "root.clear()" is # resolved, we need to keep two tests. Previously, using "del root[:]" # did not crash with the reproducer of gh-126033 while "root.clear()" # did.