Skip to content

bpo-47022: Document asynchat, asyncore and smtpd removals in 3.12 #31891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 18, 2022
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: 2 additions & 0 deletions Doc/library/asynchat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@

.. module:: asynchat
:synopsis: Support for asynchronous command/response protocols.
:deprecated:

.. moduleauthor:: Sam Rushing <[email protected]>
.. sectionauthor:: Steve Holden <[email protected]>

**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.

--------------
Expand Down
2 changes: 2 additions & 0 deletions Doc/library/asyncore.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.. module:: asyncore
:synopsis: A base class for developing asynchronous socket handling
services.
:deprecated:

.. moduleauthor:: Sam Rushing <[email protected]>
.. sectionauthor:: Christopher Petrilli <[email protected]>
Expand All @@ -13,6 +14,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.

--------------
Expand Down
2 changes: 2 additions & 0 deletions Doc/library/smtpd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

.. module:: smtpd
:synopsis: A SMTP server implementation in Python.
:deprecated:

.. moduleauthor:: Barry Warsaw <[email protected]>
.. sectionauthor:: Moshe Zadka <[email protected]>
Expand All @@ -14,6 +15,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 <https://aiosmtpd.readthedocs.io/>`_ package is a recommended
replacement for this module. It is based on :mod:`asyncio` and provides a
more straightforward API.
Expand Down
5 changes: 4 additions & 1 deletion Doc/library/superseded.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
=======
Expand Down
2 changes: 1 addition & 1 deletion Lib/asynchat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Lib/asyncore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion Lib/smtpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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`).