Skip to content

Commit b9ae871

Browse files
committed
gh-104773: PEP 594: Remove the crypt module
Remove the crypt module and its private _crypt extension, deprecated in Python 3.11.
1 parent dbcdbf1 commit b9ae871

28 files changed

+35
-991
lines changed

Doc/library/crypt.rst

Lines changed: 0 additions & 182 deletions
This file was deleted.

Doc/library/crypto.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Cryptographic Services
88

99
The modules described in this chapter implement various algorithms of a
1010
cryptographic nature. They are available at the discretion of the installation.
11-
On Unix systems, the :mod:`crypt` module may also be available.
1211
Here's an overview:
1312

1413

Doc/library/pwd.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ raised if the entry asked for cannot be found.
3939

4040
.. note::
4141

42-
.. index:: pair: module; crypt
43-
4442
In traditional Unix the field ``pw_passwd`` usually contains a password
45-
encrypted with a DES derived algorithm (see module :mod:`crypt`). However most
43+
encrypted with a DES derived algorithm. However most
4644
modern unices use a so-called *shadow password* system. On those unices the
4745
*pw_passwd* field only contains an asterisk (``'*'``) or the letter ``'x'``
4846
where the encrypted password is stored in a file :file:`/etc/shadow` which is

Doc/library/superseded.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ backwards compatibility. They have been superseded by other modules.
1313
aifc.rst
1414
audioop.rst
1515
chunk.rst
16-
crypt.rst
1716
imghdr.rst
1817
msilib.rst
1918
optparse.rst

Doc/license.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ copyright and licensing notice::
655655
OpenSSL
656656
-------
657657

658-
The modules :mod:`hashlib`, :mod:`posix`, :mod:`ssl`, :mod:`crypt` use
658+
The modules :mod:`hashlib`, :mod:`posix` and :mod:`ssl` use
659659
the OpenSSL library for added performance if made available by the
660660
operating system. Additionally, the Windows and macOS installers for
661661
Python may include a copy of the OpenSSL libraries, so we include a copy

Doc/whatsnew/3.11.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1733,7 +1733,7 @@ Modules
17331733
+---------------------+---------------------+---------------------+---------------------+---------------------+
17341734
| :mod:`aifc` | :mod:`chunk` | :mod:`msilib` | :mod:`!pipes` | :mod:`!telnetlib` |
17351735
+---------------------+---------------------+---------------------+---------------------+---------------------+
1736-
| :mod:`audioop` | :mod:`crypt` | :mod:`!nis` | :mod:`!sndhdr` | :mod:`uu` |
1736+
| :mod:`audioop` | :mod:`!crypt` | :mod:`!nis` | :mod:`!sndhdr` | :mod:`uu` |
17371737
+---------------------+---------------------+---------------------+---------------------+---------------------+
17381738
| :mod:`!cgi` | :mod:`imghdr` | :mod:`!nntplib` | :mod:`!spwd` | :mod:`!xdrlib` |
17391739
+---------------------+---------------------+---------------------+---------------------+---------------------+

Doc/whatsnew/3.12.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ Modules (see :pep:`594`):
891891
* :mod:`!cgi`
892892
* :mod:`!cgitb`
893893
* :mod:`chunk`
894-
* :mod:`crypt`
894+
* :mod:`!crypt`
895895
* :mod:`imghdr`
896896
* :mod:`!mailcap`
897897
* :mod:`msilib`

Doc/whatsnew/3.13.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,22 @@ Removed
198198
* :pep:`594`: Remove the :mod:`!xdrlib` module, deprecated in Python 3.11.
199199
(Contributed by Victor Stinner in :gh:`104773`.)
200200

201+
* :pep:`594`: Remove the :mod:`!crypt` module and its private :mod:`!_crypt`
202+
extension, deprecated in Python 3.11.
203+
The :mod:`hashlib` module is a potential replacement for certain use cases.
204+
Otherwise, the following PyPI projects can be used:
205+
206+
* `bcrypt <https://pypi.org/project/bcrypt/>`_:
207+
Modern password hashing for your software and your servers.
208+
* `passlib <https://pypi.org/project/passlib/>`_:
209+
Comprehensive password hashing framework supporting over 30 schemes.
210+
* `argon2-cffi <https://pypi.org/project/argon2-cffi/>`_:
211+
The secure Argon2 password hashing algorithm.
212+
* `legacycrypt <https://pypi.org/project/legacycrypt/>`_:
213+
Wrapper to the POSIX crypt library call and associated functionality.
214+
215+
(Contributed by Victor Stinner in :gh:`104773`.)
216+
201217

202218
Porting to Python 3.13
203219
======================

Doc/whatsnew/3.3.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,8 +1052,8 @@ their ``__init__`` method (for example, file objects) or in their
10521052
crypt
10531053
-----
10541054

1055-
Addition of salt and modular crypt format (hashing method) and the :func:`~crypt.mksalt`
1056-
function to the :mod:`crypt` module.
1055+
Addition of salt and modular crypt format (hashing method) and the :func:`~!crypt.mksalt`
1056+
function to the :mod:`!crypt` module.
10571057

10581058
(:issue:`10924`)
10591059

Doc/whatsnew/3.6.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2274,7 +2274,7 @@ Changes in the Python API
22742274
:class:`~collections.OrderedDict`.
22752275
(Contributed by Steve Holden in :issue:`27842`.)
22762276

2277-
* The :const:`crypt.METHOD_CRYPT` will no longer be added to ``crypt.methods``
2277+
* The :const:`!crypt.METHOD_CRYPT` will no longer be added to ``crypt.methods``
22782278
if unsupported by the platform.
22792279
(Contributed by Victor Stinner in :issue:`25287`.)
22802280

0 commit comments

Comments
 (0)