From 2b1a5d45da29282804346fee447b4771aaf70e66 Mon Sep 17 00:00:00 2001 From: zaveshaa Date: Sat, 22 Aug 2026 15:20:09 +0300 Subject: [PATCH 1/5] gh-156226: Fix doubled-word typos in docs and comments - Doc/library/difflib.rst: 'produced in in various formats' - Lib/multiprocessing/resource_tracker.py: 'we encode encode the raw name bytes' - Lib/test/test_exception_group.py: 'Is is also used' -> 'It is also used' - Lib/test/test_unittest/testmock/testhelpers.py: 'isn't isn't callable' --- Doc/library/difflib.rst | 2 +- Lib/multiprocessing/resource_tracker.py | 2 +- Lib/test/test_exception_group.py | 2 +- Lib/test/test_unittest/testmock/testhelpers.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst index 374af16b2b6f98..73e687ee31627e 100644 --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -17,7 +17,7 @@ This module provides classes and functions for comparing sequences. Most of them compare sequences of text lines (for example lists of strings, or :term:`file objects `) and produce :dfn:`diffs` -- reports on the differences. -Diffs can be produced in in various formats, including HTML and context +Diffs can be produced in various formats, including HTML and context and unified diffs -- formats produced by tools like :manpage:`diff ` and :manpage:`git diff `. diff --git a/Lib/multiprocessing/resource_tracker.py b/Lib/multiprocessing/resource_tracker.py index d3328a8c6170a6..6bf6cd63469ef5 100644 --- a/Lib/multiprocessing/resource_tracker.py +++ b/Lib/multiprocessing/resource_tracker.py @@ -359,7 +359,7 @@ def _send(self, cmd, name, rtype): # With json.dump(..., ensure_ascii=True) every non-ASCII byte becomes a 6-char # escape like \uDC80. # As we want the overall message to be kept atomic and therefore smaller than 512, - # we encode encode the raw name bytes with URL-safe Base64 - so a 255 long name + # we encode the raw name bytes with URL-safe Base64 - so a 255 long name # will not exceed 340 bytes. b = name.encode('utf-8', 'surrogateescape') if len(b) > 255: diff --git a/Lib/test/test_exception_group.py b/Lib/test/test_exception_group.py index f79bfa4ae2d322..c3dec5bbe2ab13 100644 --- a/Lib/test/test_exception_group.py +++ b/Lib/test/test_exception_group.py @@ -583,7 +583,7 @@ def leaf_generator(exc, tbs=None): class LeafGeneratorTest(unittest.TestCase): # The leaf_generator is mentioned in PEP 654 as a suggestion - # on how to iterate over leaf nodes of an EG. Is is also + # on how to iterate over leaf nodes of an EG. It is also # used below as a test utility. So we test it here. def test_leaf_generator(self): diff --git a/Lib/test/test_unittest/testmock/testhelpers.py b/Lib/test/test_unittest/testmock/testhelpers.py index 0e82c723ec3eaa..b2c7a0ae8004ce 100644 --- a/Lib/test/test_unittest/testmock/testhelpers.py +++ b/Lib/test/test_unittest/testmock/testhelpers.py @@ -687,7 +687,7 @@ def f(self, y): pass self.assertRaises(TypeError, instance_mock.a, 'foo', 'bar') self.assertRaises(AttributeError, getattr, instance_mock, 'b') - # The return value isn't isn't callable + # The return value isn't callable self.assertRaises(TypeError, instance_mock) instance_mock.Bar.f(6) From 30cfc2333438625a195ba7aaa13b2fcea6ee623c Mon Sep 17 00:00:00 2001 From: zaveshaa Date: Sat, 22 Aug 2026 17:58:05 +0300 Subject: [PATCH 2/5] Apply review feedback: keep only the docs fix Comments in internal code are not visible through help() and changing them is considered code churn (review by picnixz). --- Lib/multiprocessing/resource_tracker.py | 2 +- Lib/test/test_exception_group.py | 2 +- Lib/test/test_unittest/testmock/testhelpers.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/multiprocessing/resource_tracker.py b/Lib/multiprocessing/resource_tracker.py index 6bf6cd63469ef5..d3328a8c6170a6 100644 --- a/Lib/multiprocessing/resource_tracker.py +++ b/Lib/multiprocessing/resource_tracker.py @@ -359,7 +359,7 @@ def _send(self, cmd, name, rtype): # With json.dump(..., ensure_ascii=True) every non-ASCII byte becomes a 6-char # escape like \uDC80. # As we want the overall message to be kept atomic and therefore smaller than 512, - # we encode the raw name bytes with URL-safe Base64 - so a 255 long name + # we encode encode the raw name bytes with URL-safe Base64 - so a 255 long name # will not exceed 340 bytes. b = name.encode('utf-8', 'surrogateescape') if len(b) > 255: diff --git a/Lib/test/test_exception_group.py b/Lib/test/test_exception_group.py index c3dec5bbe2ab13..f79bfa4ae2d322 100644 --- a/Lib/test/test_exception_group.py +++ b/Lib/test/test_exception_group.py @@ -583,7 +583,7 @@ def leaf_generator(exc, tbs=None): class LeafGeneratorTest(unittest.TestCase): # The leaf_generator is mentioned in PEP 654 as a suggestion - # on how to iterate over leaf nodes of an EG. It is also + # on how to iterate over leaf nodes of an EG. Is is also # used below as a test utility. So we test it here. def test_leaf_generator(self): diff --git a/Lib/test/test_unittest/testmock/testhelpers.py b/Lib/test/test_unittest/testmock/testhelpers.py index b2c7a0ae8004ce..0e82c723ec3eaa 100644 --- a/Lib/test/test_unittest/testmock/testhelpers.py +++ b/Lib/test/test_unittest/testmock/testhelpers.py @@ -687,7 +687,7 @@ def f(self, y): pass self.assertRaises(TypeError, instance_mock.a, 'foo', 'bar') self.assertRaises(AttributeError, getattr, instance_mock, 'b') - # The return value isn't callable + # The return value isn't isn't callable self.assertRaises(TypeError, instance_mock) instance_mock.Bar.f(6) From a95844bf8050da91b93ed6e0119f4063c42ff2f3 Mon Sep 17 00:00:00 2001 From: zaveshaa Date: Sat, 22 Aug 2026 18:04:06 +0300 Subject: [PATCH 3/5] gh-156226: Add NEWS entry --- .../Documentation/2026-08-22.18-04-06.gh-issue-156226.eDyuCq.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Documentation/2026-08-22.18-04-06.gh-issue-156226.eDyuCq.rst diff --git a/Misc/NEWS.d/next/Documentation/2026-08-22.18-04-06.gh-issue-156226.eDyuCq.rst b/Misc/NEWS.d/next/Documentation/2026-08-22.18-04-06.gh-issue-156226.eDyuCq.rst new file mode 100644 index 00000000000000..af0574994cb028 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2026-08-22.18-04-06.gh-issue-156226.eDyuCq.rst @@ -0,0 +1 @@ +Remove a doubled word ("in in") in the :mod:`difflib` documentation. From b0d52e0c162a9ca3b42e226c9ca8c88af9251b4b Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Sat, 22 Aug 2026 16:40:58 +0100 Subject: [PATCH 4/5] Delete Misc/NEWS.d/next/Documentation/2026-08-22.18-04-06.gh-issue-156226.eDyuCq.rst --- .../Documentation/2026-08-22.18-04-06.gh-issue-156226.eDyuCq.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Misc/NEWS.d/next/Documentation/2026-08-22.18-04-06.gh-issue-156226.eDyuCq.rst diff --git a/Misc/NEWS.d/next/Documentation/2026-08-22.18-04-06.gh-issue-156226.eDyuCq.rst b/Misc/NEWS.d/next/Documentation/2026-08-22.18-04-06.gh-issue-156226.eDyuCq.rst deleted file mode 100644 index af0574994cb028..00000000000000 --- a/Misc/NEWS.d/next/Documentation/2026-08-22.18-04-06.gh-issue-156226.eDyuCq.rst +++ /dev/null @@ -1 +0,0 @@ -Remove a doubled word ("in in") in the :mod:`difflib` documentation. From d7e0baf4bf767bbbc40ff9cfcf6af8a8165a98a3 Mon Sep 17 00:00:00 2001 From: zaveshaa Date: Sat, 22 Aug 2026 19:44:16 +0300 Subject: [PATCH 5/5] Remove one more doubled word in difflib docs (per review request) --- Doc/library/difflib.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst index 73e687ee31627e..5339186b72f6bc 100644 --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -52,7 +52,7 @@ By default, if the second input sequence is at least 200 items long, items that account for more than 1% it are considered *junk*. Depending on your data, you should consider turning this heuristic off -(setting :class:`~difflib.SequenceMatcher`'s *autojunk* argument to to ``False``) +(setting :class:`~difflib.SequenceMatcher`'s *autojunk* argument to ``False``) or tuning it (using the *isjunk* argument, perhaps to one of the :ref:`predefined functions `).