Skip to content

Commit

Permalink
gh-104773: PEP 594: Remove the spwd module (#104871)
Browse files Browse the repository at this point in the history
Remove spwd from the configure script and Modules/Setup.
  • Loading branch information
vstinner authored May 24, 2023
1 parent 160321e commit 684e99d
Show file tree
Hide file tree
Showing 19 changed files with 16 additions and 581 deletions.
4 changes: 0 additions & 4 deletions Doc/library/grp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,3 @@ It defines the following items:

Module :mod:`pwd`
An interface to the user database, similar to this.

Module :mod:`spwd`
An interface to the shadow password database, similar to this.

7 changes: 1 addition & 6 deletions Doc/library/pwd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ raised if the entry asked for cannot be found.
*pw_passwd* field only contains an asterisk (``'*'``) or the letter ``'x'``
where the encrypted password is stored in a file :file:`/etc/shadow` which is
not world readable. Whether the *pw_passwd* field contains anything useful is
system-dependent. If available, the :mod:`spwd` module should be used where
access to the encrypted password is required.
system-dependent.

It defines the following items:

Expand All @@ -72,7 +71,3 @@ It defines the following items:

Module :mod:`grp`
An interface to the group database, similar to this.

Module :mod:`spwd`
An interface to the shadow password database, similar to this.

82 changes: 0 additions & 82 deletions Doc/library/spwd.rst

This file was deleted.

1 change: 0 additions & 1 deletion Doc/library/superseded.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ backwards compatibility. They have been superseded by other modules.
nis.rst
nntplib.rst
optparse.rst
spwd.rst
uu.rst
xdrlib.rst
2 changes: 1 addition & 1 deletion Doc/whatsnew/2.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,7 @@ complete list of changes, or look through the SVN logs for all the details.
:meth:`getproto` accessor methods to retrieve the family, type, and protocol
values for the socket.

* New module: the :mod:`spwd` module provides functions for accessing the shadow
* New module: the :mod:`!spwd` module provides functions for accessing the shadow
password database on systems that support shadow passwords.

* The :mod:`struct` is now faster because it compiles format strings into
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ Modules
+---------------------+---------------------+---------------------+---------------------+---------------------+
| :mod:`audioop` | :mod:`crypt` | :mod:`nis` | :mod:`!sndhdr` | :mod:`uu` |
+---------------------+---------------------+---------------------+---------------------+---------------------+
| :mod:`!cgi` | :mod:`imghdr` | :mod:`nntplib` | :mod:`spwd` | :mod:`xdrlib` |
| :mod:`!cgi` | :mod:`imghdr` | :mod:`nntplib` | :mod:`!spwd` | :mod:`xdrlib` |
+---------------------+---------------------+---------------------+---------------------+---------------------+
| :mod:`!cgitb` | :mod:`!mailcap` | :mod:`!ossaudiodev` | :mod:`!sunau` | |
+---------------------+---------------------+---------------------+---------------------+---------------------+
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ Modules (see :pep:`594`):
* :mod:`!ossaudiodev`
* :mod:`!pipes`
* :mod:`!sndhdr`
* :mod:`spwd`
* :mod:`!spwd`
* :mod:`!sunau`
* :mod:`!telnetlib`
* :mod:`uu`
Expand Down
5 changes: 5 additions & 0 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ Removed
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 <https://pypi.org/project/python-pam/>`_ can be used
instead.
(Contributed by Victor Stinner in :gh:`104773`.)


Porting to Python 3.13
======================
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2211,7 +2211,7 @@ Changes in the Python API
the exception will stop a single-threaded server. (Contributed by
Martin Panter in :issue:`23430`.)

* :func:`spwd.getspnam` now raises a :exc:`PermissionError` instead of
* :func:`!spwd.getspnam` now raises a :exc:`PermissionError` instead of
:exc:`KeyError` if the user doesn't have privileges.

* The :meth:`socket.socket.close` method now raises an exception if
Expand Down
77 changes: 0 additions & 77 deletions Lib/test/test_spwd.py

This file was deleted.

2 changes: 1 addition & 1 deletion Misc/NEWS.d/3.10.0a3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@ Port _struct extension module to multiphase initialization (:pep:`489`)
.. nonce: 6F9o6L
.. section: C API
Port :mod:`spwd` extension module to multiphase initialization (:pep:`489`)
Port :mod:`!spwd` extension module to multiphase initialization (:pep:`489`)

..
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:pep:`594`: Remove the :mod:`!spwd` module, deprecated in Python 3.11: the
`python-pam project <https://pypi.org/project/python-pam/>`_ can be used
instead. Patch by Victor Stinner.
1 change: 0 additions & 1 deletion Modules/Setup
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ PYTHONPATH=$(COREPYTHONPATH)
#fcntl fcntlmodule.c
#grp grpmodule.c
#resource resource.c
#spwd spwdmodule.c
#syslog syslogmodule.c
#termios termios.c

Expand Down
2 changes: 0 additions & 2 deletions Modules/Setup.stdlib.in
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@
@MODULE_RESOURCE_TRUE@resource resource.c
@MODULE_SELECT_TRUE@select selectmodule.c
@MODULE__SOCKET_TRUE@_socket socketmodule.c
# AIX has shadow passwords, but does not provide getspent API
@MODULE_SPWD_TRUE@spwd spwdmodule.c
@MODULE_SYSLOG_TRUE@syslog syslogmodule.c
@MODULE_TERMIOS_TRUE@termios termios.c

Expand Down
80 changes: 0 additions & 80 deletions Modules/clinic/spwdmodule.c.h

This file was deleted.

Loading

0 comments on commit 684e99d

Please sign in to comment.