You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[TECH DEBT] DeprecationWarning: 'spwd' is deprecated and slated for removal in Python 3.13 #64264
Description of the tech debt to be addressed, include links and screenshots
/usr/lib/python3.11/site-packages/salt/modules/linux_shadow.py:21: DeprecationWarning: 'spwd' is deprecated and slated for removal in Python 3.13
import spwd
Versions Report
Salt Version:
Salt: 3006.1
Python Version:
Python: 3.11.3 (main, Apr 5 2023, 15:52:25) [GCC 12.2.1 20230201]
Dependency Versions:
cffi: 1.15.1
cherrypy: Not Installed
dateutil: 2.8.2
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 3.1.2
libgit2: Not Installed
looseversion: 1.1.2
M2Crypto: 0.38.0
Mako: 1.2.4
msgpack: 1.0.4
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 23.0
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.12.0
pygit2: Not Installed
python-gnupg: Not Installed
PyYAML: 6.0
PyZMQ: 25.0.2
relenv: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.4
System Versions:
dist: Arch Linux | Kernel: 6.3.1
locale: utf-8
machine: x86_64
release: 6.3.1-arch1-1
system: Linux
version: Arch Linux | Kernel: 6.3.1
In general, it’s a bad idea to use spwd. It circumvents system security policies, does not use the PAM stack, and is only compatible with local user accounts, because it ignores NSS. The use of the spwd module for access control must be considered a security bug, as it bypasses PAM’s access control.
It is currently imported by salt.modules.linux_shadow and salt.modules.solaris_shadow.
File "/var/tmp/.ubuntu_8f32de_salt/pyall/salt/modules/linux_shadow.py", line 74, in info
getspnam = functools.partial(spwd.getspnam)
^^^^
NameError: name 'spwd' is not defined
Any patch/mitigation anyone?
Salt-report:
Salt Version:
Salt: 3007.8
Python Version:
Python: 3.13.7 (main, Aug 15 2025, 12:34:02) [GCC 15.2.1 20250813]
Dependency Versions:
cffi: 2.0.0
cherrypy: 18.10.0
cryptography: 46.0.3
dateutil: 2.9.0
docker-py: 7.1.0
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 3.1.6
libgit2: Not Installed
looseversion: 1.3.0
M2Crypto: Not Installed
Mako: 1.3.10
msgpack: 1.1.2
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 25.0
pycparser: 2.23
pycrypto: 3.23.0
pycryptodome: 3.23.0
pygit2: Not Installed
python-gnupg: 0.5.5
PyYAML: 6.0.3
PyZMQ: 27.1.0
relenv: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 6.5.2
ZMQ: 4.3.5
Salt Package Information:
Package Type: Not Installed
System Versions:
dist: arch
locale: utf-8
machine: x86_64
release: 6.12.58-1-lts
system: Linux
version: Arch Linux
Fix merged and shipped in a supported release. Closing per bulk triage. Reopen if this reproduces on a currently supported release (3006.x, 3007.x, 3008.x, master).
Activity
OrangeDog commentedon Nov 29, 2023
Also from PEP-594:
It is currently imported by
salt.modules.linux_shadowandsalt.modules.solaris_shadow.foudfou commentedon Nov 20, 2025
Yep. So now it's actually gone:
Any patch/mitigation anyone?
Salt-report:
dwoz commentedon Jul 2, 2026
Fix merged and shipped in a supported release. Closing per bulk triage. Reopen if this reproduces on a currently supported release (3006.x, 3007.x, 3008.x, master).
Fix solaris_shadow spwd usage on Python 3.13+
lcsiki commentedon Jul 7, 2026
This persists on 3006.27 I'm afraid.
Fix linux_shadow and solaris_shadow spwd usage on Python 3.13+ (#64264)…
foudfou commentedon Jul 30, 2026
Definitely still an issue in
Restore junos/linux_shadow fixes dropped by the botched-merge revert
Restore junos/linux_shadow fixes dropped by the botched-merge revert