[3.13] Docs: re-create pages for removed modules to document their removal. (GH-126622) (#126709)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
diff --git a/Doc/library/aifc.rst b/Doc/library/aifc.rst
new file mode 100644
index 0000000..a756d67
--- /dev/null
+++ b/Doc/library/aifc.rst
@@ -0,0 +1,15 @@
+:mod:`!aifc` --- Read and write AIFF and AIFC files
+===================================================
+
+.. module:: aifc
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+The last version of Python that provided the :mod:`!aifc` module was
+`Python 3.12 <https://docs.python.org/3.12/library/aifc.html>`_.
diff --git a/Doc/library/asynchat.rst b/Doc/library/asynchat.rst
new file mode 100644
index 0000000..5e5c3a9
--- /dev/null
+++ b/Doc/library/asynchat.rst
@@ -0,0 +1,17 @@
+:mod:`!asynchat` --- Asynchronous socket command/response handler
+=================================================================
+
+.. module:: asynchat
+   :synopsis: Removed in 3.12.
+   :deprecated:
+
+.. deprecated-removed:: 3.6 3.12
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.12 <whatsnew312-removed>` after
+being deprecated in Python 3.6.  The removal was decided in :pep:`594`.
+
+Applications should use the :mod:`asyncio` module instead.
+
+The last version of Python that provided the :mod:`!asynchat` module was
+`Python 3.11 <https://docs.python.org/3.11/library/asynchat.html>`_.
diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst
new file mode 100644
index 0000000..22c9881
--- /dev/null
+++ b/Doc/library/asyncore.rst
@@ -0,0 +1,17 @@
+:mod:`!asyncore` --- Asynchronous socket handler
+================================================
+
+.. module:: asyncore
+   :synopsis: Removed in 3.12.
+   :deprecated:
+
+.. deprecated-removed:: 3.6 3.12
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.12 <whatsnew312-removed>` after
+being deprecated in Python 3.6.  The removal was decided in :pep:`594`.
+
+Applications should use the :mod:`asyncio` module instead.
+
+The last version of Python that provided the :mod:`!asyncore` module was
+`Python 3.11 <https://docs.python.org/3.11/library/asyncore.html>`_.
diff --git a/Doc/library/audioop.rst b/Doc/library/audioop.rst
new file mode 100644
index 0000000..3bc580b
--- /dev/null
+++ b/Doc/library/audioop.rst
@@ -0,0 +1,15 @@
+:mod:`!audioop` --- Manipulate raw audio data
+=============================================
+
+.. module:: audioop
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+The last version of Python that provided the :mod:`!audioop` module was
+`Python 3.12 <https://docs.python.org/3.12/library/audioop.html>`_.
diff --git a/Doc/library/cgi.rst b/Doc/library/cgi.rst
new file mode 100644
index 0000000..f9108fa
--- /dev/null
+++ b/Doc/library/cgi.rst
@@ -0,0 +1,19 @@
+:mod:`!cgi` --- Common Gateway Interface support
+================================================
+
+.. module:: cgi
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+A fork of the module on PyPI can be used instead: :pypi:`legacy-cgi`.
+This is a copy of the cgi module, no longer maintained or supported by the core
+Python team.
+
+The last version of Python that provided the :mod:`!cgi` module was
+`Python 3.12 <https://docs.python.org/3.12/library/cgi.html>`_.
diff --git a/Doc/library/cgitb.rst b/Doc/library/cgitb.rst
new file mode 100644
index 0000000..fc646aa
--- /dev/null
+++ b/Doc/library/cgitb.rst
@@ -0,0 +1,19 @@
+:mod:`!cgitb` --- Traceback manager for CGI scripts
+===================================================
+
+.. module:: cgitb
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+A fork of the module on PyPI can now be used instead: :pypi:`legacy-cgi`.
+This is a copy of the cgi module, no longer maintained or supported by the core
+Python team.
+
+The last version of Python that provided the :mod:`!cgitb` module was
+`Python 3.12 <https://docs.python.org/3.12/library/cgitb.html>`_.
diff --git a/Doc/library/chunk.rst b/Doc/library/chunk.rst
new file mode 100644
index 0000000..9950a0e
--- /dev/null
+++ b/Doc/library/chunk.rst
@@ -0,0 +1,15 @@
+:mod:`!chunk` --- Read IFF chunked data
+=======================================
+
+.. module:: chunk
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+The last version of Python that provided the :mod:`!chunk` module was
+`Python 3.12 <https://docs.python.org/3.12/library/chunk.html>`_.
diff --git a/Doc/library/crypt.rst b/Doc/library/crypt.rst
new file mode 100644
index 0000000..9ff3719
--- /dev/null
+++ b/Doc/library/crypt.rst
@@ -0,0 +1,20 @@
+:mod:`!crypt` --- Function to check Unix passwords
+==================================================
+
+.. module:: crypt
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+Applications can use the :mod:`hashlib` module from the standard library.
+Other possible replacements are third-party libraries from PyPI:
+:pypi:`legacycrypt`, :pypi:`bcrypt`, :pypi:`argon2-cffi`, or :pypi:`passlib`.
+These are not supported or maintained by the Python core team.
+
+The last version of Python that provided the :mod:`!crypt` module was
+`Python 3.12 <https://docs.python.org/3.12/library/crypt.html>`_.
diff --git a/Doc/library/distutils.rst b/Doc/library/distutils.rst
new file mode 100644
index 0000000..af63e03
--- /dev/null
+++ b/Doc/library/distutils.rst
@@ -0,0 +1,17 @@
+:mod:`!distutils` --- Building and installing Python modules
+============================================================
+
+.. module:: distutils
+   :synopsis: Removed in 3.12.
+   :deprecated:
+
+.. deprecated-removed:: 3.10 3.12
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.12 <whatsnew312-removed-distutils>` after
+being deprecated in Python 3.10.  The removal was decided in :pep:`632`,
+which has `migration advice
+<https://peps.python.org/pep-0632/#migration-advice>`_.
+
+The last version of Python that provided the :mod:`!distutils` module was
+`Python 3.11 <https://docs.python.org/3.11/library/distutils.html>`_.
diff --git a/Doc/library/imghdr.rst b/Doc/library/imghdr.rst
new file mode 100644
index 0000000..56f2635
--- /dev/null
+++ b/Doc/library/imghdr.rst
@@ -0,0 +1,19 @@
+:mod:`!imghdr` --- Determine the type of an image
+=================================================
+
+.. module:: imghdr
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+Possible replacements are third-party libraries from PyPI:
+:pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-magic`.
+These are not supported or maintained by the Python core team.
+
+The last version of Python that provided the :mod:`!imghdr` module was
+`Python 3.12 <https://docs.python.org/3.12/library/imghdr.html>`_.
diff --git a/Doc/library/imp.rst b/Doc/library/imp.rst
new file mode 100644
index 0000000..3dc4c56
--- /dev/null
+++ b/Doc/library/imp.rst
@@ -0,0 +1,18 @@
+:mod:`!imp` --- Access the import internals
+===========================================
+
+.. module:: imp
+   :synopsis: Removed in 3.12.
+   :deprecated:
+
+.. deprecated-removed:: 3.4 3.12
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.12 <whatsnew312-removed-imp>` after
+being deprecated in Python 3.4.
+
+The :ref:`removal notice <whatsnew312-removed-imp>` includes guidance for
+migrating code from :mod:`!imp` to :mod:`importlib`.
+
+The last version of Python that provided the :mod:`!imp` module was
+`Python 3.11 <https://docs.python.org/3.11/library/imp.html>`_.
diff --git a/Doc/library/index.rst b/Doc/library/index.rst
index 0b348ae..951fbcf 100644
--- a/Doc/library/index.rst
+++ b/Doc/library/index.rst
@@ -75,4 +75,5 @@
    unix.rst
    cmdline.rst
    superseded.rst
+   removed.rst
    security_warnings.rst
diff --git a/Doc/library/mailcap.rst b/Doc/library/mailcap.rst
new file mode 100644
index 0000000..4467da1
--- /dev/null
+++ b/Doc/library/mailcap.rst
@@ -0,0 +1,15 @@
+:mod:`!mailcap` --- Mailcap file handling
+=========================================
+
+.. module:: mailcap
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+The last version of Python that provided the :mod:`!mailcap` module was
+`Python 3.12 <https://docs.python.org/3.12/library/mailcap.html>`_.
diff --git a/Doc/library/msilib.rst b/Doc/library/msilib.rst
new file mode 100644
index 0000000..eb1ac55
--- /dev/null
+++ b/Doc/library/msilib.rst
@@ -0,0 +1,15 @@
+:mod:`!msilib` --- Read and write Microsoft Installer files
+===========================================================
+
+.. module:: msilib
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+The last version of Python that provided the :mod:`!msilib` module was
+`Python 3.12 <https://docs.python.org/3.12/library/msilib.html>`_.
diff --git a/Doc/library/nis.rst b/Doc/library/nis.rst
new file mode 100644
index 0000000..dcc36dd
--- /dev/null
+++ b/Doc/library/nis.rst
@@ -0,0 +1,15 @@
+:mod:`!nis` --- Interface to Sun’s NIS (Yellow Pages)
+=====================================================
+
+.. module:: nis
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+The last version of Python that provided the :mod:`!nis` module was
+`Python 3.12 <https://docs.python.org/3.12/library/nis.html>`_.
diff --git a/Doc/library/nntplib.rst b/Doc/library/nntplib.rst
new file mode 100644
index 0000000..8053fe8
--- /dev/null
+++ b/Doc/library/nntplib.rst
@@ -0,0 +1,15 @@
+:mod:`!nntplib` --- NNTP protocol client
+========================================
+
+.. module:: nntplib
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+The last version of Python that provided the :mod:`!nntplib` module was
+`Python 3.12 <https://docs.python.org/3.12/library/nntplib.html>`_.
diff --git a/Doc/library/ossaudiodev.rst b/Doc/library/ossaudiodev.rst
new file mode 100644
index 0000000..320adbe
--- /dev/null
+++ b/Doc/library/ossaudiodev.rst
@@ -0,0 +1,15 @@
+:mod:`!ossaudiodev` --- Access to OSS-compatible audio devices
+==============================================================
+
+.. module:: ossaudiodev
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+The last version of Python that provided the :mod:`!ossaudiodev` module was
+`Python 3.12 <https://docs.python.org/3.12/library/ossaudiodev.html>`_.
diff --git a/Doc/library/pipes.rst b/Doc/library/pipes.rst
new file mode 100644
index 0000000..d9bcc3a
--- /dev/null
+++ b/Doc/library/pipes.rst
@@ -0,0 +1,17 @@
+:mod:`!pipes` --- Interface to shell pipelines
+==============================================
+
+.. module:: pipes
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+Applications should use the :mod:`subprocess` module instead.
+
+The last version of Python that provided the :mod:`!pipes` module was
+`Python 3.12 <https://docs.python.org/3.12/library/pipes.html>`_.
diff --git a/Doc/library/removed.rst b/Doc/library/removed.rst
new file mode 100644
index 0000000..4d75842
--- /dev/null
+++ b/Doc/library/removed.rst
@@ -0,0 +1,39 @@
+:tocdepth: 1
+
+.. _removed:
+
+***************
+Removed Modules
+***************
+
+The modules described in this chapter have been removed from the Python
+standard library.  They are documented here to help people find replacements.
+
+
+.. toctree::
+   :maxdepth: 1
+
+   aifc.rst
+   asynchat.rst
+   asyncore.rst
+   audioop.rst
+   cgi.rst
+   cgitb.rst
+   chunk.rst
+   crypt.rst
+   distutils.rst
+   imghdr.rst
+   imp.rst
+   mailcap.rst
+   msilib.rst
+   nis.rst
+   nntplib.rst
+   ossaudiodev.rst
+   pipes.rst
+   smtpd.rst
+   sndhdr.rst
+   spwd.rst
+   sunau.rst
+   telnetlib.rst
+   uu.rst
+   xdrlib.rst
diff --git a/Doc/library/smtpd.rst b/Doc/library/smtpd.rst
new file mode 100644
index 0000000..c704f4a
--- /dev/null
+++ b/Doc/library/smtpd.rst
@@ -0,0 +1,18 @@
+:mod:`!smtpd` --- SMTP Server
+=============================
+
+.. module:: smtpd
+   :synopsis: Removed in 3.12.
+   :deprecated:
+
+.. deprecated-removed:: 3.6 3.12
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.12 <whatsnew312-removed>` after
+being deprecated in Python 3.6.  The removal was decided in :pep:`594`.
+
+A possible replacement is the third-party :pypi:`aiosmtpd` library. This
+library is not maintained or supported by the Python core team.
+
+The last version of Python that provided the :mod:`!smtpd` module was
+`Python 3.11 <https://docs.python.org/3.11/library/smtpd.html>`_.
diff --git a/Doc/library/sndhdr.rst b/Doc/library/sndhdr.rst
new file mode 100644
index 0000000..6b71db4
--- /dev/null
+++ b/Doc/library/sndhdr.rst
@@ -0,0 +1,19 @@
+:mod:`!sndhdr` --- Determine type of sound file
+===============================================
+
+.. module:: sndhdr
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+Possible replacements are third-party modules from PyPI:
+:pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-magic`.
+These are not supported or maintained by the Python core team.
+
+The last version of Python that provided the :mod:`!sndhdr` module was
+`Python 3.12 <https://docs.python.org/3.12/library/sndhdr.html>`_.
diff --git a/Doc/library/spwd.rst b/Doc/library/spwd.rst
new file mode 100644
index 0000000..c16854b
--- /dev/null
+++ b/Doc/library/spwd.rst
@@ -0,0 +1,18 @@
+:mod:`!spwd` --- The shadow password database
+=============================================
+
+.. module:: spwd
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+A possible replacement is the third-party library :pypi:`python-pam`.
+This library is not supported or maintained by the Python core team.
+
+The last version of Python that provided the :mod:`!spwd` module was
+`Python 3.12 <https://docs.python.org/3.12/library/spwd.html>`_.
diff --git a/Doc/library/sunau.rst b/Doc/library/sunau.rst
new file mode 100644
index 0000000..feb7768
--- /dev/null
+++ b/Doc/library/sunau.rst
@@ -0,0 +1,15 @@
+:mod:`!sunau` --- Read and write Sun AU files
+=============================================
+
+.. module:: sunau
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+The last version of Python that provided the :mod:`!sunau` module was
+`Python 3.12 <https://docs.python.org/3.12/library/sunau.html>`_.
diff --git a/Doc/library/telnetlib.rst b/Doc/library/telnetlib.rst
new file mode 100644
index 0000000..6971ad3
--- /dev/null
+++ b/Doc/library/telnetlib.rst
@@ -0,0 +1,19 @@
+:mod:`!telnetlib` --- Telnet client
+===================================
+
+.. module:: telnetlib
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+Possible replacements are third-party libraries from PyPI: :pypi:`telnetlib3`
+or :pypi:`Exscript`.  These are not supported or maintained by the Python core
+team.
+
+The last version of Python that provided the :mod:`!telnetlib` module was
+`Python 3.12 <https://docs.python.org/3.12/library/telnetlib.html>`_.
diff --git a/Doc/library/uu.rst b/Doc/library/uu.rst
new file mode 100644
index 0000000..0636d18
--- /dev/null
+++ b/Doc/library/uu.rst
@@ -0,0 +1,15 @@
+:mod:`!uu` --- Encode and decode uuencode files
+===============================================
+
+.. module:: uu
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+The last version of Python that provided the :mod:`!uu` module was
+`Python 3.12 <https://docs.python.org/3.12/library/uu.html>`_.
diff --git a/Doc/library/xdrlib.rst b/Doc/library/xdrlib.rst
new file mode 100644
index 0000000..59b801c
--- /dev/null
+++ b/Doc/library/xdrlib.rst
@@ -0,0 +1,15 @@
+:mod:`!xdrlib` --- Encode and decode XDR data
+=============================================
+
+.. module:: xdrlib
+   :synopsis: Removed in 3.13.
+   :deprecated:
+
+.. deprecated-removed:: 3.11 3.13
+
+This module is no longer part of the Python standard library.
+It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
+being deprecated in Python 3.11.  The removal was decided in :pep:`594`.
+
+The last version of Python that provided the :mod:`!xdrlib` module was
+`Python 3.12 <https://docs.python.org/3.12/library/xdrlib.html>`_.
diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst
index 934ac32..d2b0911 100644
--- a/Doc/whatsnew/3.12.rst
+++ b/Doc/whatsnew/3.12.rst
@@ -1341,6 +1341,8 @@
 
 .. include:: ../deprecations/pending-removal-in-future.rst
 
+.. _whatsnew312-removed:
+
 Removed
 =======
 
@@ -1366,6 +1368,8 @@
   * :class:`configparser.ConfigParser` no longer has a ``readfp`` method.
     Use :meth:`~configparser.ConfigParser.read_file` instead.
 
+.. _whatsnew312-removed-distutils:
+
 distutils
 ---------
 
@@ -1447,6 +1451,8 @@
   * ``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader``
     have been removed.  (Contributed by Barry Warsaw in :gh:`98040`.)
 
+.. _whatsnew312-removed-imp:
+
 imp
 ---
 
diff --git a/Misc/NEWS.d/next/Documentation/2024-11-09-19-43-10.gh-issue-126622.YacfDc.rst b/Misc/NEWS.d/next/Documentation/2024-11-09-19-43-10.gh-issue-126622.YacfDc.rst
new file mode 100644
index 0000000..a2181b5
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2024-11-09-19-43-10.gh-issue-126622.YacfDc.rst
@@ -0,0 +1,3 @@
+Added stub pages for removed modules explaining their removal, where to find
+replacements, and linking to the last Python version that supported them.
+Contributed by Ned Batchelder.