Skip to content

Commit 684e99d

Browse files
authored
gh-104773: PEP 594: Remove the spwd module (#104871)
Remove spwd from the configure script and Modules/Setup.
1 parent 160321e commit 684e99d

19 files changed

+16
-581
lines changed

Doc/library/grp.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,3 @@ It defines the following items:
6363

6464
Module :mod:`pwd`
6565
An interface to the user database, similar to this.
66-
67-
Module :mod:`spwd`
68-
An interface to the shadow password database, similar to this.
69-

Doc/library/pwd.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ raised if the entry asked for cannot be found.
4747
*pw_passwd* field only contains an asterisk (``'*'``) or the letter ``'x'``
4848
where the encrypted password is stored in a file :file:`/etc/shadow` which is
4949
not world readable. Whether the *pw_passwd* field contains anything useful is
50-
system-dependent. If available, the :mod:`spwd` module should be used where
51-
access to the encrypted password is required.
50+
system-dependent.
5251

5352
It defines the following items:
5453

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

7372
Module :mod:`grp`
7473
An interface to the group database, similar to this.
75-
76-
Module :mod:`spwd`
77-
An interface to the shadow password database, similar to this.
78-

Doc/library/spwd.rst

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

Doc/library/superseded.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ backwards compatibility. They have been superseded by other modules.
1919
nis.rst
2020
nntplib.rst
2121
optparse.rst
22-
spwd.rst
2322
uu.rst
2423
xdrlib.rst

Doc/whatsnew/2.5.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,7 @@ complete list of changes, or look through the SVN logs for all the details.
15421542
:meth:`getproto` accessor methods to retrieve the family, type, and protocol
15431543
values for the socket.
15441544

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

15481548
* The :mod:`struct` is now faster because it compiles format strings into

Doc/whatsnew/3.11.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1735,7 +1735,7 @@ Modules
17351735
+---------------------+---------------------+---------------------+---------------------+---------------------+
17361736
| :mod:`audioop` | :mod:`crypt` | :mod:`nis` | :mod:`!sndhdr` | :mod:`uu` |
17371737
+---------------------+---------------------+---------------------+---------------------+---------------------+
1738-
| :mod:`!cgi` | :mod:`imghdr` | :mod:`nntplib` | :mod:`spwd` | :mod:`xdrlib` |
1738+
| :mod:`!cgi` | :mod:`imghdr` | :mod:`nntplib` | :mod:`!spwd` | :mod:`xdrlib` |
17391739
+---------------------+---------------------+---------------------+---------------------+---------------------+
17401740
| :mod:`!cgitb` | :mod:`!mailcap` | :mod:`!ossaudiodev` | :mod:`!sunau` | |
17411741
+---------------------+---------------------+---------------------+---------------------+---------------------+

Doc/whatsnew/3.12.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ Modules (see :pep:`594`):
900900
* :mod:`!ossaudiodev`
901901
* :mod:`!pipes`
902902
* :mod:`!sndhdr`
903-
* :mod:`spwd`
903+
* :mod:`!spwd`
904904
* :mod:`!sunau`
905905
* :mod:`!telnetlib`
906906
* :mod:`uu`

Doc/whatsnew/3.13.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ Removed
168168
The :mod:`mimetypes` module provides an alternative.
169169
(Contributed by Victor Stinner in :gh:`104773`.)
170170

171+
* :pep:`594`: Remove the :mod:`!spwd` module, deprecated in Python 3.11:
172+
the `python-pam project <https://pypi.org/project/python-pam/>`_ can be used
173+
instead.
174+
(Contributed by Victor Stinner in :gh:`104773`.)
175+
171176

172177
Porting to Python 3.13
173178
======================

Doc/whatsnew/3.6.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2211,7 +2211,7 @@ Changes in the Python API
22112211
the exception will stop a single-threaded server. (Contributed by
22122212
Martin Panter in :issue:`23430`.)
22132213

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

22172217
* The :meth:`socket.socket.close` method now raises an exception if

Lib/test/test_spwd.py

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

Misc/NEWS.d/3.10.0a3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,7 @@ Port _struct extension module to multiphase initialization (:pep:`489`)
12961296
.. nonce: 6F9o6L
12971297
.. section: C API
12981298
1299-
Port :mod:`spwd` extension module to multiphase initialization (:pep:`489`)
1299+
Port :mod:`!spwd` extension module to multiphase initialization (:pep:`489`)
13001300

13011301
..
13021302
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:pep:`594`: Remove the :mod:`!spwd` module, deprecated in Python 3.11: the
2+
`python-pam project <https://pypi.org/project/python-pam/>`_ can be used
3+
instead. Patch by Victor Stinner.

Modules/Setup

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ PYTHONPATH=$(COREPYTHONPATH)
185185
#fcntl fcntlmodule.c
186186
#grp grpmodule.c
187187
#resource resource.c
188-
#spwd spwdmodule.c
189188
#syslog syslogmodule.c
190189
#termios termios.c
191190

Modules/Setup.stdlib.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@
119119
@MODULE_RESOURCE_TRUE@resource resource.c
120120
@MODULE_SELECT_TRUE@select selectmodule.c
121121
@MODULE__SOCKET_TRUE@_socket socketmodule.c
122-
# AIX has shadow passwords, but does not provide getspent API
123-
@MODULE_SPWD_TRUE@spwd spwdmodule.c
124122
@MODULE_SYSLOG_TRUE@syslog syslogmodule.c
125123
@MODULE_TERMIOS_TRUE@termios termios.c
126124

Modules/clinic/spwdmodule.c.h

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

0 commit comments

Comments
 (0)