Skip to content

Commit 7747384

Browse files
authored
bpo-47022: Document asynchat, asyncore and smtpd removals in 3.12 (GH-31891)
Document the deprecation of asyncore, asynchat, and smtpd with a slated removal in Python 3.12 thanks to PEP 594.
1 parent 3a2b895 commit 7747384

File tree

9 files changed

+23
-4
lines changed

9 files changed

+23
-4
lines changed

Doc/library/asynchat.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33

44
.. module:: asynchat
55
:synopsis: Support for asynchronous command/response protocols.
6+
:deprecated:
67

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

1011
**Source code:** :source:`Lib/asynchat.py`
1112

1213
.. deprecated:: 3.6
14+
:mod:`asynchat` will be removed in Python 3.12 (:pep:`594`).
1315
Please use :mod:`asyncio` instead.
1416

1517
--------------

Doc/library/asyncore.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.. module:: asyncore
55
:synopsis: A base class for developing asynchronous socket handling
66
services.
7+
:deprecated:
78

89
.. moduleauthor:: Sam Rushing <[email protected]>
910
.. sectionauthor:: Christopher Petrilli <[email protected]>
@@ -13,6 +14,7 @@
1314
**Source code:** :source:`Lib/asyncore.py`
1415

1516
.. deprecated:: 3.6
17+
:mod:`asyncore` will be removed in Python 3.12 (:pep:`594`).
1618
Please use :mod:`asyncio` instead.
1719

1820
--------------

Doc/library/smtpd.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
.. module:: smtpd
55
:synopsis: A SMTP server implementation in Python.
6+
:deprecated:
67

78
.. moduleauthor:: Barry Warsaw <[email protected]>
89
.. sectionauthor:: Moshe Zadka <[email protected]>
@@ -14,6 +15,7 @@
1415
This module offers several classes to implement SMTP (email) servers.
1516

1617
.. deprecated:: 3.6
18+
:mod:`smtpd` will be removed in Python 3.12 (:pep:`594`).
1719
The `aiosmtpd <https://aiosmtpd.readthedocs.io/>`_ package is a recommended
1820
replacement for this module. It is based on :mod:`asyncio` and provides a
1921
more straightforward API.

Doc/library/superseded.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@ backwards compatibility. They have been superseded by other modules.
1010

1111
.. toctree::
1212

13-
optparse.rst
13+
asynchat.rst
14+
asyncore.rst
15+
smtpd.rst
1416
imp.rst
17+
optparse.rst

Doc/whatsnew/3.11.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,11 @@ Deprecated
555555
:func:`locale.getlocale` functions instead.
556556
(Contributed by Victor Stinner in :issue:`46659`.)
557557

558+
* The :mod:`asynchat`, :mod:`asyncore` and :mod:`smtpd` modules have been
559+
deprecated since at least Python 3.6. Their documentation and deprecation
560+
warnings have now been updated to note they will removed in Python 3.12
561+
(:pep:`594`).
562+
(Contributed by Hugo van Kemenade in :issue:`47022`.)
558563

559564
Removed
560565
=======

Lib/asynchat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
from warnings import warn
5252
warn(
53-
'The asynchat module is deprecated. '
53+
'The asynchat module is deprecated and will be removed in Python 3.12. '
5454
'The recommended replacement is asyncio',
5555
DeprecationWarning,
5656
stacklevel=2)

Lib/asyncore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
errorcode
5959

6060
warnings.warn(
61-
'The asyncore module is deprecated. '
61+
'The asyncore module is deprecated and will be removed in Python 3.12. '
6262
'The recommended replacement is asyncio',
6363
DeprecationWarning,
6464
stacklevel=2)

Lib/smtpd.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@
8585
]
8686

8787
warn(
88-
'The smtpd module is deprecated and unmaintained. Please see aiosmtpd '
88+
'The smtpd module is deprecated and unmaintained and will be removed '
89+
'in Python 3.12. Please see aiosmtpd '
8990
'(https://aiosmtpd.readthedocs.io/) for the recommended replacement.',
9091
DeprecationWarning,
9192
stacklevel=2)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
The :mod:`asynchat`, :mod:`asyncore` and :mod:`smtpd` modules have been
2+
deprecated since at least Python 3.6. Their documentation and deprecation
3+
warnings and have now been updated to note they will removed in Python 3.12
4+
(:pep:`594`).

0 commit comments

Comments
 (0)