They took away cgi… which I was of course using.
And crypt.
They don't care about breaking things. People would not migrate to python4 so they just break everything in python3 :D
FWIW, the Python developers have wanted to drop the cgi module for over 20 years. It has no maintainer.
Depending on your needs, you might consider:
1) versioning and maintaining your own copy of cgi.py;
2) use something like https://pypi.org/project/legacy-cgi/ (I have not vetted it) which is a forked copy of cgi and cgitb; or
3) use the CGI capabilities of wsgiref (I used it for one CGI project to allow a future transition away from CGI).
As for "crypt" - wow! I haven't seen anyone use that since the 1990s!
Again, the code is short, and easy to vendor, except for the _crypt extension module.
For that, you might be able to use ctypes, like this:
>>> from ctypes.util import find_library
>>> find_library("c")
'/usr/lib/libc.dylib'
>>> from ctypes import cdll
>>> libc = cdll.LoadLibrary(find_library("c"))
>>> import ctypes
>>> libc.crypt.argtypes = [ctypes.c_char_p, ctypes.c_char_p]
>>> libc.crypt.restype = ctypes.c_char_p
>>> libc.crypt(b"toomanysecrets", b"az")
b'azi4LBG1VJohQ'
Here is what Python's own _crypt does: >>> import _crypt
>>> _crypt.crypt("toomanysecrets", "az")
'azi4LBG1VJohQ'In practice, what that means is if there is a bug report, like https://github.com/python/cpython/issues/71964 from 2016, then the fix may languish for years as no one in the core team is able to resolve it. You can see several people reported the bug, along with a comment from 2022 that "The cgi module is now deprecated following the acceptance of PEP 594" so will not be fixed.
The fixes I saw likely fall into the un-questionable changes that can be decided by any committer.
It works. Does it need a maintainer?
The point isn't how to replace them. The point is that I have stuff that works and has been working for several years and will stop working.
The Python core developers have had a practice of removing standard library packages for over 30 years, including packages that - like cgi.py - worked.
For example, modules removed with Python 2.0 included cmp, cmpcache, dircmp, dump, find, grep, packmail, poly, stdwin, util, whatsound, and zmod.
Python 2.4 removed mpz, rotor, and xreadlines - no more Enigma machine emulation for you, and I had to change my code because I used xreadlines.
Python 3.0 removed even more modules: cl, md5, sha, rfc822, and more. Plus it did some library reorganization.
Ever use the "parser" module? I did. It was removed in 3.10 because of the switch to the PEG parser.
PEP 594 re-affirms the reasoning behind the long-given practice removing old packages.
There are language communities with a stronger commitment to not breaking old code. COBOL is fantastically backwards compatible, for an obvious example.
I urge you to consider the options I gave. The functionality you want can be done using the standard library without that much effort.