From 161916cffe4b16f9377998088817ffb6f2545d51 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Thu, 7 Jul 2022 10:00:23 +0100 Subject: [PATCH 01/11] deprecate the MultiLoopChildWatcher --- Doc/library/asyncio-policy.rst | 1 + Lib/asyncio/unix_events.py | 1 + 2 files changed, 2 insertions(+) diff --git a/Doc/library/asyncio-policy.rst b/Doc/library/asyncio-policy.rst index ef6a0588506b52..f75569959c417b 100644 --- a/Doc/library/asyncio-policy.rst +++ b/Doc/library/asyncio-policy.rst @@ -232,6 +232,7 @@ implementation used by the asyncio event loop: :py:data:`SIGCHLD` is received). .. versionadded:: 3.8 + .. deprecated:: 3.12 .. class:: SafeChildWatcher diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py index cf7683fee64621..f5a035b3bb06de 100644 --- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -1229,6 +1229,7 @@ class MultiLoopChildWatcher(AbstractChildWatcher): # but retrieves the current loop by get_running_loop() def __init__(self): + warnings._deprecated("asyncio.MultiLoopChildWatcher", remove=(3, 14)) self._callbacks = {} self._saved_sighandler = None From 5b2f92082e90ef2d6b856adfd77a310813a127fe Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Thu, 7 Jul 2022 09:04:52 +0000 Subject: [PATCH 02/11] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20b?= =?UTF-8?q?lurb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Library/2022-07-07-09-04-49.gh-issue-82504.6xtYAz.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2022-07-07-09-04-49.gh-issue-82504.6xtYAz.rst diff --git a/Misc/NEWS.d/next/Library/2022-07-07-09-04-49.gh-issue-82504.6xtYAz.rst b/Misc/NEWS.d/next/Library/2022-07-07-09-04-49.gh-issue-82504.6xtYAz.rst new file mode 100644 index 00000000000000..e4bbc41c5aff3c --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-07-07-09-04-49.gh-issue-82504.6xtYAz.rst @@ -0,0 +1 @@ +deprecate the ``asyncio.MultiLoopChildWatcher`` From 88b01a4070daef1929b010673d0bb21ac4eb12a2 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Thu, 7 Jul 2022 10:12:07 +0100 Subject: [PATCH 03/11] delete the skipped MultiLoopChildWatcher tests --- Lib/test/test_asyncio/test_subprocess.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py index 09a5c390b36299..4b2496ac278d6c 100644 --- a/Lib/test/test_asyncio/test_subprocess.py +++ b/Lib/test/test_asyncio/test_subprocess.py @@ -668,13 +668,6 @@ class SubprocessThreadedWatcherTests(SubprocessWatcherMixin, Watcher = unix_events.ThreadedChildWatcher - @unittest.skip("bpo-38323: MultiLoopChildWatcher has a race condition \ - and these tests can hang the test suite") - class SubprocessMultiLoopWatcherTests(SubprocessWatcherMixin, - test_utils.TestCase): - - Watcher = unix_events.MultiLoopChildWatcher - class SubprocessSafeWatcherTests(SubprocessWatcherMixin, test_utils.TestCase): From 9a2100f45308477fa32e433f41c0b957bfea387b Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Thu, 7 Jul 2022 10:16:39 +0100 Subject: [PATCH 04/11] test that the MultiLoopChildWatcher is deprecated --- Lib/test/test_asyncio/test_subprocess.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py index 4b2496ac278d6c..6ed0758932d7b4 100644 --- a/Lib/test/test_asyncio/test_subprocess.py +++ b/Lib/test/test_asyncio/test_subprocess.py @@ -695,6 +695,12 @@ class SubprocessPidfdWatcherTests(SubprocessWatcherMixin, test_utils.TestCase): Watcher = unix_events.PidfdChildWatcher + + class MultiLoopChildWatcherTests(unittest.TestCase): + def test_deprecated(self): + with self.assertWarns(DeprecationWarning): + asyncio.MultiLoopChildWatcher() + else: # Windows class SubprocessProactorTests(SubprocessMixin, test_utils.TestCase): From ae826fafe831adf79311d33c07b6f676a337d211 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 18 Jul 2022 16:19:59 +0100 Subject: [PATCH 05/11] Update Misc/NEWS.d/next/Library/2022-07-07-09-04-49.gh-issue-82504.6xtYAz.rst Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> --- .../next/Library/2022-07-07-09-04-49.gh-issue-82504.6xtYAz.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2022-07-07-09-04-49.gh-issue-82504.6xtYAz.rst b/Misc/NEWS.d/next/Library/2022-07-07-09-04-49.gh-issue-82504.6xtYAz.rst index e4bbc41c5aff3c..91c7a6543a60c5 100644 --- a/Misc/NEWS.d/next/Library/2022-07-07-09-04-49.gh-issue-82504.6xtYAz.rst +++ b/Misc/NEWS.d/next/Library/2022-07-07-09-04-49.gh-issue-82504.6xtYAz.rst @@ -1 +1 @@ -deprecate the ``asyncio.MultiLoopChildWatcher`` +Deprecate :class:`asyncio.MultiLoopChildWatcher` to be removed in Python 3.14. From 1ef16e9ada37d19ef6ad03640bd8a8e5a714e73b Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 18 Jul 2022 16:20:30 +0100 Subject: [PATCH 06/11] Update Doc/library/asyncio-policy.rst --- Doc/library/asyncio-policy.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/asyncio-policy.rst b/Doc/library/asyncio-policy.rst index f75569959c417b..aae040923c935e 100644 --- a/Doc/library/asyncio-policy.rst +++ b/Doc/library/asyncio-policy.rst @@ -232,7 +232,7 @@ implementation used by the asyncio event loop: :py:data:`SIGCHLD` is received). .. versionadded:: 3.8 - .. deprecated:: 3.12 + .. deprecated-remove:: 3.12 3.14 .. class:: SafeChildWatcher From dff64a5c7d0ae424662849cd1db237a4e412d373 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 18 Jul 2022 16:21:11 +0100 Subject: [PATCH 07/11] Update Doc/library/asyncio-policy.rst --- Doc/library/asyncio-policy.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/asyncio-policy.rst b/Doc/library/asyncio-policy.rst index aae040923c935e..b2e2ab3ed834f8 100644 --- a/Doc/library/asyncio-policy.rst +++ b/Doc/library/asyncio-policy.rst @@ -232,7 +232,7 @@ implementation used by the asyncio event loop: :py:data:`SIGCHLD` is received). .. versionadded:: 3.8 - .. deprecated-remove:: 3.12 3.14 + .. deprecated-removed:: 3.12 3.14 .. class:: SafeChildWatcher From 4b379b47fa5c00c0de4820104f60888aab946aae Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 18 Jul 2022 16:26:56 +0100 Subject: [PATCH 08/11] add what's new section for MultiLoopChildWatcher --- Doc/whatsnew/3.12.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index a095baa5eace22..e486d67ddc3dad 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -171,6 +171,18 @@ APIs: * :func:`unittest.getTestCaseNames` (:gh:`50096`) * :class:`webbrowser.MacOSX` (:gh:`86421`) + +Pending Removal in Python 3.14 +============================== + +The following modules and APIs have been deprecated in earlier Python releases, +and will be removed in Python 3.14. + +APIs: + +* :class:`asyncio.MultiLoopChildWatcher` (:gh:`94648`) + + Pending Removal in Future Versions ================================== From a14a6945414eaf47c2006358b6c9fbc2b24cdfb0 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 18 Jul 2022 17:11:18 +0100 Subject: [PATCH 09/11] move the MultiLoopChildWatcher deprecation to the empty 'Deprecated' heading --- Doc/whatsnew/3.12.rst | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index e486d67ddc3dad..8ed46e8eaa41f6 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -132,6 +132,13 @@ CPython bytecode changes Deprecated ========== +The following modules and APIs have been deprecated in this Python release, +and will be removed in Python 3.14. + +APIs: + +* :class:`asyncio.MultiLoopChildWatcher` (:gh:`94648`) + Pending Removal in Python 3.13 ============================== @@ -172,17 +179,6 @@ APIs: * :class:`webbrowser.MacOSX` (:gh:`86421`) -Pending Removal in Python 3.14 -============================== - -The following modules and APIs have been deprecated in earlier Python releases, -and will be removed in Python 3.14. - -APIs: - -* :class:`asyncio.MultiLoopChildWatcher` (:gh:`94648`) - - Pending Removal in Future Versions ================================== From 821ccfcbc34f08747061090fe4ede04f7e343037 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 18 Jul 2022 17:11:47 +0100 Subject: [PATCH 10/11] Update Doc/whatsnew/3.12.rst --- Doc/whatsnew/3.12.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 8ed46e8eaa41f6..8eb793e12190cf 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -178,7 +178,6 @@ APIs: * :func:`unittest.getTestCaseNames` (:gh:`50096`) * :class:`webbrowser.MacOSX` (:gh:`86421`) - Pending Removal in Future Versions ================================== From 2e6e996d2196fe9cecf807edcfda429c1b918f8d Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 18 Jul 2022 17:18:21 +0100 Subject: [PATCH 11/11] split Deprecated by when the deprecations are schduled --- Doc/whatsnew/3.12.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 8c12c22a1db699..0bb4b70c5895c9 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -138,6 +138,12 @@ and will be removed in Python 3.14. APIs: * :class:`asyncio.MultiLoopChildWatcher` (:gh:`94648`) + +The following APIs were deprecated in this Python release and will be removed, +although there is currently no date scheduled for their removal. + +APIs: + * :class:`typing.Hashable` and :class:`typing.Sized` aliases for :class:`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:gh:`94309`)