From 3eb9ba8be5a54db3d2b8377cdeb30e26ef8562ab Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Mon, 14 Mar 2022 17:41:40 +0200 Subject: [PATCH 1/3] bpo-47022: Document asynchat, asyncore and smtpd removals in 3.12 --- Doc/library/asynchat.rst | 1 + Doc/library/asyncore.rst | 1 + Doc/library/smtpd.rst | 1 + Doc/whatsnew/3.11.rst | 5 +++++ Lib/asynchat.py | 2 +- Lib/asyncore.py | 2 +- Lib/smtpd.py | 3 ++- .../next/Library/2022-03-15-09-29-52.bpo-47022.uaEDcI.rst | 4 ++++ 8 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2022-03-15-09-29-52.bpo-47022.uaEDcI.rst diff --git a/Doc/library/asynchat.rst b/Doc/library/asynchat.rst index 9e51416b83a570..6cd2ecbca5bcfa 100644 --- a/Doc/library/asynchat.rst +++ b/Doc/library/asynchat.rst @@ -10,6 +10,7 @@ **Source code:** :source:`Lib/asynchat.py` .. deprecated:: 3.6 + :mod:`asynchat` will be removed in Python 3.12 (:pep:`594`). Please use :mod:`asyncio` instead. -------------- diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst index a86518ebff2777..bb8ce5c83a7324 100644 --- a/Doc/library/asyncore.rst +++ b/Doc/library/asyncore.rst @@ -13,6 +13,7 @@ **Source code:** :source:`Lib/asyncore.py` .. deprecated:: 3.6 + :mod:`asyncore` will be removed in Python 3.12 (:pep:`594`). Please use :mod:`asyncio` instead. -------------- diff --git a/Doc/library/smtpd.rst b/Doc/library/smtpd.rst index 611411ddd295b2..fc621316975b32 100644 --- a/Doc/library/smtpd.rst +++ b/Doc/library/smtpd.rst @@ -14,6 +14,7 @@ This module offers several classes to implement SMTP (email) servers. .. deprecated:: 3.6 + :mod:`smtpd` will be removed in Python 3.12 (:pep:`594`). The `aiosmtpd `_ package is a recommended replacement for this module. It is based on :mod:`asyncio` and provides a more straightforward API. diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 9fbf46791c27db..3990cb57a285a8 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -523,6 +523,11 @@ Deprecated :func:`locale.getlocale` functions instead. (Contributed by Victor Stinner in :issue:`46659`.) +* The :mod:`asynchat`, :mod:`asyncore` and :mod:`smtpd` modules have been + deprecated since at least Python 3.6. Their documentation and deprecation + warnings have now been updated to note they will removed in Python 3.12 + (:pep:`594`). + (Contributed by Hugo van Kemenade in :issue:`47022`.) Removed ======= diff --git a/Lib/asynchat.py b/Lib/asynchat.py index de26ffa648ffec..e081e67c75acb0 100644 --- a/Lib/asynchat.py +++ b/Lib/asynchat.py @@ -50,7 +50,7 @@ from warnings import warn warn( - 'The asynchat module is deprecated. ' + 'The asynchat module is deprecated and will be removed in Python 3.12. ' 'The recommended replacement is asyncio', DeprecationWarning, stacklevel=2) diff --git a/Lib/asyncore.py b/Lib/asyncore.py index b1eea4bf652118..a360d404395e5b 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -58,7 +58,7 @@ errorcode warnings.warn( - 'The asyncore module is deprecated. ' + 'The asyncore module is deprecated and will be removed in Python 3.12. ' 'The recommended replacement is asyncio', DeprecationWarning, stacklevel=2) diff --git a/Lib/smtpd.py b/Lib/smtpd.py index 1cd004fbc6fe5b..eeda155b920f75 100755 --- a/Lib/smtpd.py +++ b/Lib/smtpd.py @@ -85,7 +85,8 @@ ] warn( - 'The smtpd module is deprecated and unmaintained. Please see aiosmtpd ' + 'The smtpd module is deprecated and unmaintained and will be removed ' + 'in Python 3.12. Please see aiosmtpd ' '(https://aiosmtpd.readthedocs.io/) for the recommended replacement.', DeprecationWarning, stacklevel=2) diff --git a/Misc/NEWS.d/next/Library/2022-03-15-09-29-52.bpo-47022.uaEDcI.rst b/Misc/NEWS.d/next/Library/2022-03-15-09-29-52.bpo-47022.uaEDcI.rst new file mode 100644 index 00000000000000..0e867b9506484f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-03-15-09-29-52.bpo-47022.uaEDcI.rst @@ -0,0 +1,4 @@ +The :mod:`asynchat`, :mod:`asyncore` and :mod:`smtpd` modules have been +deprecated since at least Python 3.6. Their documentation and deprecation +warnings and have now been updated to note they will removed in Python 3.12 +(:pep:`594`). From f0b38425c8ff629f94ab9d25e196fdb5c14ac7d6 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Wed, 16 Mar 2022 10:25:20 +0200 Subject: [PATCH 2/3] bpo-47022: Mark asynchat, asyncore and smtpd as deprecated in module list --- Doc/library/asynchat.rst | 1 + Doc/library/asyncore.rst | 1 + Doc/library/smtpd.rst | 1 + 3 files changed, 3 insertions(+) diff --git a/Doc/library/asynchat.rst b/Doc/library/asynchat.rst index 6cd2ecbca5bcfa..4354444a1d3314 100644 --- a/Doc/library/asynchat.rst +++ b/Doc/library/asynchat.rst @@ -3,6 +3,7 @@ .. module:: asynchat :synopsis: Support for asynchronous command/response protocols. + :deprecated: .. moduleauthor:: Sam Rushing .. sectionauthor:: Steve Holden diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst index bb8ce5c83a7324..e481e13db76f70 100644 --- a/Doc/library/asyncore.rst +++ b/Doc/library/asyncore.rst @@ -4,6 +4,7 @@ .. module:: asyncore :synopsis: A base class for developing asynchronous socket handling services. + :deprecated: .. moduleauthor:: Sam Rushing .. sectionauthor:: Christopher Petrilli diff --git a/Doc/library/smtpd.rst b/Doc/library/smtpd.rst index fc621316975b32..6b37a0517063d0 100644 --- a/Doc/library/smtpd.rst +++ b/Doc/library/smtpd.rst @@ -3,6 +3,7 @@ .. module:: smtpd :synopsis: A SMTP server implementation in Python. + :deprecated: .. moduleauthor:: Barry Warsaw .. sectionauthor:: Moshe Zadka From 4f5e33b45596e9fb8ff20962efd0507fa7e0f98e Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Wed, 16 Mar 2022 10:27:32 +0200 Subject: [PATCH 3/3] bpo-47022: List asynchat, asyncore and smtpd on deprecated modules page --- Doc/library/superseded.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Doc/library/superseded.rst b/Doc/library/superseded.rst index 50a5983236e76a..fd23e4d1536d38 100644 --- a/Doc/library/superseded.rst +++ b/Doc/library/superseded.rst @@ -10,5 +10,8 @@ backwards compatibility. They have been superseded by other modules. .. toctree:: - optparse.rst + asynchat.rst + asyncore.rst + smtpd.rst imp.rst + optparse.rst