From b469a31ba5b2ca1dff8b5caa20e05030cd4cc2bb Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 17 Oct 2023 10:30:39 +0300 Subject: [PATCH 1/4] Add PEP 594 to release highlights --- Doc/whatsnew/3.13.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index a932be43413b1e..7572a811159c4f 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -65,7 +65,14 @@ Summary -- Release highlights .. PEP-sized items next. - +Important deprecations, removals or restrictions: + +* :pep:`594`: The remainder of the dead batteries have been removed from the + standard library, 19 in all: + :mod:`!aifc`, :mod:`!audioop`, :mod:`!cgi`, :mod:`!cgitb`, :mod:`!chunk`, + :mod:`!crypt`, :mod:`!imghdr`, :mod:`!mailcap`, :mod:`!msilib`, :mod:`!nis`, + :mod:`!nntplib`, :mod:`!ossaudiodev`, :mod:`!pipes`, :mod:`!sndhdr`, :mod:`!spwd`, + :mod:`!sunau`, :mod:`!telnetlib`, :mod:`!uu` and :mod:`!xdrlib`. New Features ============ From bf34fdfda28e1e51dd267387fc8af23f3fa656a3 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 17 Oct 2023 10:38:52 +0300 Subject: [PATCH 2/4] Group PEP 594 removals, move shared deprecation info to top --- Doc/whatsnew/3.13.rst | 229 +++++++++++++++++++++--------------------- 1 file changed, 116 insertions(+), 113 deletions(-) diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 7572a811159c4f..75b0567c257c3e 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -688,10 +688,122 @@ although there is currently no date scheduled for their removal. Removed ======= -* :pep:`594`: Remove the :mod:`!telnetlib` module, deprecated in Python 3.11: - use the projects `telnetlib3 `_ or - `Exscript `_ instead. - (Contributed by Victor Stinner in :gh:`104773`.) +PEP 594: dead batteries +----------------------- + +* :pep:`594`: Removed 19 modules from the standard library, + deprecated in Python 3.11: + + * :mod:`!telnetlib`, :use the projects + `telnetlib3 `_ or + `Exscript `_ instead. + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!cgi` and :mod:`!cgitb`. + + * ``cgi.FieldStorage`` can typically be replaced with + :func:`urllib.parse.parse_qsl` for ``GET`` and ``HEAD`` requests, + and the :mod:`email.message` module or `multipart + `__ PyPI project for ``POST`` and + ``PUT``. + + * ``cgi.parse()`` can be replaced by calling :func:`urllib.parse.parse_qs` + directly on the desired query string, except for ``multipart/form-data`` + input, which can be handled as described for ``cgi.parse_multipart()``. + + * ``cgi.parse_multipart()`` can be replaced with the functionality in the + :mod:`email` package (e.g. :class:`email.message.EmailMessage` and + :class:`email.message.Message`) which implements the same MIME RFCs, or + with the `multipart `__ PyPI project. + + * ``cgi.parse_header()`` can be replaced with the functionality in the + :mod:`email` package, which implements the same MIME RFCs. For example, + with :class:`email.message.EmailMessage`:: + + from email.message import EmailMessage + msg = EmailMessage() + msg['content-type'] = 'application/json; charset="utf8"' + main, params = msg.get_content_type(), msg['content-type'].params + + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!sndhdr`: use the projects + `filetype `_, + `puremagic `_, or + `python-magic `_ instead. + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!pipes`: use the :mod:`subprocess` module instead. + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!ossaudiodev`: use the + `pygame project `_ for audio playback. + (Contributed by Victor Stinner in :gh:`104780`.) + + * :mod:`!sunau`. + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!mailcap`. + The :mod:`mimetypes` module provides an alternative. + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!spwd`: + the `python-pam project `_ + can be used instead. + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!nntplib`: + the `PyPI nntplib project `_ + can be used instead. + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!nis`. + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!xdrlib`. + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!msilib`. + (Contributed by Zachary Ware in :gh:`104773`.) + + * :mod:`!crypt` module and its private :mod:`!_crypt` extension. + The :mod:`hashlib` module is a potential replacement for certain use cases. + Otherwise, the following PyPI projects can be used: + + * `bcrypt `_: + Modern password hashing for your software and your servers. + * `passlib `_: + Comprehensive password hashing framework supporting over 30 schemes. + * `argon2-cffi `_: + The secure Argon2 password hashing algorithm. + * `legacycrypt `_: + Wrapper to the POSIX crypt library call and associated functionality. + + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!uu`: the :mod:`base64` module is a modern alternative. + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!aifc`. + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!audioop`. + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!chunk`. + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!imghdr`: + use the projects + `filetype `_, + `puremagic `_, + or `python-magic `_ instead. + (Contributed by Victor Stinner in :gh:`104773`.) + +* Remove support for the keyword-argument method of creating + :class:`typing.TypedDict` types, deprecated in Python 3.11. + (Contributed by Tomas Roun in :gh:`104786`.) + * Remove the ``2to3`` program and the :mod:`!lib2to3` module, deprecated in Python 3.11. @@ -733,115 +845,6 @@ Removed (Contributed by Hugo van Kemenade in :gh:`104835`.) -* :pep:`594`: Remove the :mod:`!cgi` and :mod:`!cgitb` modules, - deprecated in Python 3.11. - - * ``cgi.FieldStorage`` can typically be replaced with - :func:`urllib.parse.parse_qsl` for ``GET`` and ``HEAD`` requests, and the - :mod:`email.message` module or `multipart - `__ PyPI project for ``POST`` and - ``PUT``. - - * ``cgi.parse()`` can be replaced by calling :func:`urllib.parse.parse_qs` - directly on the desired query string, except for ``multipart/form-data`` - input, which can be handled as described for ``cgi.parse_multipart()``. - - * ``cgi.parse_multipart()`` can be replaced with the functionality in the - :mod:`email` package (e.g. :class:`email.message.EmailMessage` and - :class:`email.message.Message`) which implements the same MIME RFCs, or - with the `multipart `__ PyPI project. - - * ``cgi.parse_header()`` can be replaced with the functionality in the - :mod:`email` package, which implements the same MIME RFCs. For example, - with :class:`email.message.EmailMessage`:: - - from email.message import EmailMessage - msg = EmailMessage() - msg['content-type'] = 'application/json; charset="utf8"' - main, params = msg.get_content_type(), msg['content-type'].params - - (Contributed by Victor Stinner in :gh:`104773`.) - -* :pep:`594`: Remove the :mod:`!sndhdr` module, deprecated in Python 3.11: use - the projects `filetype `_, `puremagic - `_, or `python-magic - `_ instead. - (Contributed by Victor Stinner in :gh:`104773`.) - -* :pep:`594`: Remove the :mod:`!pipes` module, deprecated in Python 3.11: - use the :mod:`subprocess` module instead. - (Contributed by Victor Stinner in :gh:`104773`.) - -* :pep:`594`: Remove the :mod:`!ossaudiodev` module, deprecated in Python 3.11: - use the `pygame project `_ for audio playback. - (Contributed by Victor Stinner in :gh:`104780`.) - -* :pep:`594`: Remove the :mod:`!sunau` module, deprecated in Python 3.11. - (Contributed by Victor Stinner in :gh:`104773`.) - -* :pep:`594`: Remove the :mod:`!mailcap` module, deprecated in Python 3.11. - The :mod:`mimetypes` module provides an alternative. - (Contributed by Victor Stinner in :gh:`104773`.) - -* :pep:`594`: Remove the :mod:`!spwd` module, deprecated in Python 3.11: - the `python-pam project `_ can be used - instead. - (Contributed by Victor Stinner in :gh:`104773`.) - -* :pep:`594`: Remove the :mod:`!nntplib` module, deprecated in Python 3.11: - the `PyPI nntplib project `_ can be used - instead. - (Contributed by Victor Stinner in :gh:`104773`.) - -* :pep:`594`: Remove the :mod:`!nis` module, deprecated in Python 3.11. - (Contributed by Victor Stinner in :gh:`104773`.) - -* :pep:`594`: Remove the :mod:`!xdrlib` module, deprecated in Python 3.11. - (Contributed by Victor Stinner in :gh:`104773`.) - -* :pep:`594`: Remove the :mod:`!msilib` module, deprecated in Python 3.11. - (Contributed by Zachary Ware in :gh:`104773`.) - -* :pep:`594`: Remove the :mod:`!crypt` module and its private :mod:`!_crypt` - extension, deprecated in Python 3.11. - The :mod:`hashlib` module is a potential replacement for certain use cases. - Otherwise, the following PyPI projects can be used: - - * `bcrypt `_: - Modern password hashing for your software and your servers. - * `passlib `_: - Comprehensive password hashing framework supporting over 30 schemes. - * `argon2-cffi `_: - The secure Argon2 password hashing algorithm. - * `legacycrypt `_: - Wrapper to the POSIX crypt library call and associated functionality. - - (Contributed by Victor Stinner in :gh:`104773`.) - -* :pep:`594`: Remove the :mod:`!uu` module, deprecated in Python 3.11: - the :mod:`base64` module is a modern alternative. - (Contributed by Victor Stinner in :gh:`104773`.) - -* :pep:`594`: Remove the :mod:`!aifc` module, deprecated in Python 3.11. - (Contributed by Victor Stinner in :gh:`104773`.) - -* :pep:`594`: Remove the :mod:`!audioop` module, deprecated in Python 3.11. - (Contributed by Victor Stinner in :gh:`104773`.) - -* :pep:`594`: Remove the :mod:`!chunk` module, deprecated in Python 3.11. - (Contributed by Victor Stinner in :gh:`104773`.) - -* Remove support for the keyword-argument method of creating - :class:`typing.TypedDict` types, deprecated in Python 3.11. - (Contributed by Tomas Roun in :gh:`104786`.) - -* :pep:`594`: Remove the :mod:`!imghdr` module, deprecated in Python 3.11: - use the projects - `filetype `_, - `puremagic `_, - or `python-magic `_ instead. - (Contributed by Victor Stinner in :gh:`104773`.) - * Remove the untested and undocumented :meth:`!unittest.TestProgram.usageExit` method, deprecated in Python 3.11. (Contributed by Hugo van Kemenade in :gh:`104992`.) From eb8c0b21124f1e1d27edc3369a5fe83b907cb129 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 17 Oct 2023 10:41:07 +0300 Subject: [PATCH 3/4] Sort PEP 594 modules --- Doc/whatsnew/3.13.rst | 101 +++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 51 deletions(-) diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 75b0567c257c3e..13066503bef4e5 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -691,12 +691,16 @@ Removed PEP 594: dead batteries ----------------------- -* :pep:`594`: Removed 19 modules from the standard library, +* :pep:`594` removed 19 modules from the standard library, deprecated in Python 3.11: - * :mod:`!telnetlib`, :use the projects - `telnetlib3 `_ or - `Exscript `_ instead. + * :mod:`!aifc`. + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!audioop`. + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!chunk`. (Contributed by Victor Stinner in :gh:`104773`.) * :mod:`!cgi` and :mod:`!cgitb`. @@ -711,11 +715,6 @@ PEP 594: dead batteries directly on the desired query string, except for ``multipart/form-data`` input, which can be handled as described for ``cgi.parse_multipart()``. - * ``cgi.parse_multipart()`` can be replaced with the functionality in the - :mod:`email` package (e.g. :class:`email.message.EmailMessage` and - :class:`email.message.Message`) which implements the same MIME RFCs, or - with the `multipart `__ PyPI project. - * ``cgi.parse_header()`` can be replaced with the functionality in the :mod:`email` package, which implements the same MIME RFCs. For example, with :class:`email.message.EmailMessage`:: @@ -725,31 +724,42 @@ PEP 594: dead batteries msg['content-type'] = 'application/json; charset="utf8"' main, params = msg.get_content_type(), msg['content-type'].params - (Contributed by Victor Stinner in :gh:`104773`.) + * ``cgi.parse_multipart()`` can be replaced with the functionality in the + :mod:`email` package (e.g. :class:`email.message.EmailMessage` and + :class:`email.message.Message`) which implements the same MIME RFCs, or + with the `multipart `__ PyPI project. - * :mod:`!sndhdr`: use the projects - `filetype `_, - `puremagic `_, or - `python-magic `_ instead. (Contributed by Victor Stinner in :gh:`104773`.) - * :mod:`!pipes`: use the :mod:`subprocess` module instead. - (Contributed by Victor Stinner in :gh:`104773`.) + * :mod:`!crypt` module and its private :mod:`!_crypt` extension. + The :mod:`hashlib` module is a potential replacement for certain use cases. + Otherwise, the following PyPI projects can be used: - * :mod:`!ossaudiodev`: use the - `pygame project `_ for audio playback. - (Contributed by Victor Stinner in :gh:`104780`.) + * `bcrypt `_: + Modern password hashing for your software and your servers. + * `passlib `_: + Comprehensive password hashing framework supporting over 30 schemes. + * `argon2-cffi `_: + The secure Argon2 password hashing algorithm. + * `legacycrypt `_: + Wrapper to the POSIX crypt library call and associated functionality. - * :mod:`!sunau`. + (Contributed by Victor Stinner in :gh:`104773`.) + + * :mod:`!imghdr`: use the projects + `filetype `_, + `puremagic `_, + or `python-magic `_ instead. (Contributed by Victor Stinner in :gh:`104773`.) * :mod:`!mailcap`. The :mod:`mimetypes` module provides an alternative. (Contributed by Victor Stinner in :gh:`104773`.) - * :mod:`!spwd`: - the `python-pam project `_ - can be used instead. + * :mod:`!msilib`. + (Contributed by Zachary Ware in :gh:`104773`.) + + * :mod:`!nis`. (Contributed by Victor Stinner in :gh:`104773`.) * :mod:`!nntplib`: @@ -757,47 +767,36 @@ PEP 594: dead batteries can be used instead. (Contributed by Victor Stinner in :gh:`104773`.) - * :mod:`!nis`. - (Contributed by Victor Stinner in :gh:`104773`.) + * :mod:`!ossaudiodev`: use the + `pygame project `_ for audio playback. + (Contributed by Victor Stinner in :gh:`104780`.) - * :mod:`!xdrlib`. + * :mod:`!pipes`: use the :mod:`subprocess` module instead. (Contributed by Victor Stinner in :gh:`104773`.) - * :mod:`!msilib`. - (Contributed by Zachary Ware in :gh:`104773`.) - - * :mod:`!crypt` module and its private :mod:`!_crypt` extension. - The :mod:`hashlib` module is a potential replacement for certain use cases. - Otherwise, the following PyPI projects can be used: - - * `bcrypt `_: - Modern password hashing for your software and your servers. - * `passlib `_: - Comprehensive password hashing framework supporting over 30 schemes. - * `argon2-cffi `_: - The secure Argon2 password hashing algorithm. - * `legacycrypt `_: - Wrapper to the POSIX crypt library call and associated functionality. - + * :mod:`!sndhdr`: use the projects + `filetype `_, + `puremagic `_, or + `python-magic `_ instead. (Contributed by Victor Stinner in :gh:`104773`.) - * :mod:`!uu`: the :mod:`base64` module is a modern alternative. + * :mod:`!spwd`: + the `python-pam project `_ + can be used instead. (Contributed by Victor Stinner in :gh:`104773`.) - * :mod:`!aifc`. + * :mod:`!sunau`. (Contributed by Victor Stinner in :gh:`104773`.) - * :mod:`!audioop`. + * :mod:`!telnetlib`, use the projects + `telnetlib3 `_ or + `Exscript `_ instead. (Contributed by Victor Stinner in :gh:`104773`.) - * :mod:`!chunk`. + * :mod:`!uu`: the :mod:`base64` module is a modern alternative. (Contributed by Victor Stinner in :gh:`104773`.) - * :mod:`!imghdr`: - use the projects - `filetype `_, - `puremagic `_, - or `python-magic `_ instead. + * :mod:`!xdrlib`. (Contributed by Victor Stinner in :gh:`104773`.) * Remove support for the keyword-argument method of creating From e3b52e1cc424aaf55adc7687526f6e2a293d5a8c Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 17 Oct 2023 18:06:40 +0300 Subject: [PATCH 4/4] Link PEP 594 highlight to details --- Doc/whatsnew/3.13.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 13066503bef4e5..776fef3264564b 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -67,8 +67,8 @@ Summary -- Release highlights Important deprecations, removals or restrictions: -* :pep:`594`: The remainder of the dead batteries have been removed from the - standard library, 19 in all: +* :ref:`PEP 594 `: The remaining 19 "dead batteries" + have been removed from the standard library: :mod:`!aifc`, :mod:`!audioop`, :mod:`!cgi`, :mod:`!cgitb`, :mod:`!chunk`, :mod:`!crypt`, :mod:`!imghdr`, :mod:`!mailcap`, :mod:`!msilib`, :mod:`!nis`, :mod:`!nntplib`, :mod:`!ossaudiodev`, :mod:`!pipes`, :mod:`!sndhdr`, :mod:`!spwd`, @@ -688,6 +688,8 @@ although there is currently no date scheduled for their removal. Removed ======= +.. _whatsnew313-pep594: + PEP 594: dead batteries -----------------------