Page MenuHomeVyOS Platform

Python3 modules crypt and spwd are deprecated
Closed, ResolvedPublicFEATURE REQUEST

Description

Python3 modules crypt and spwd are deprecated

vyos@r14:~$ sudo python3 -c 'import crypt'
<string>:1: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13
vyos@r14:~$ 
vyos@r14:~$ 
vyos@r14:~$ sudo python3 -c 'from spwd import getspnam'
<string>:1: DeprecationWarning: 'spwd' is deprecated and slated for removal in Python 3.13
vyos@r14:~$ 

vyos@r14:~$ sudo python3 -V
Python 3.11.1
vyos@r14:~$

At least they used in https://github.com/vyos/vyos-1x/blob/dcb4a95c796132988258447d99430541aae955cb/src/conf_mode/system-login.py#L19-L24
And openconnect https://github.com/vyos/vyos-1x/blob/1cc8d7c89459ecfe315cab47458af5cc00d975ca/src/conf_mode/vpn_openconnect.py#L32

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Unspecified (please specify)

Event Timeline

Openconnect

[edit]
vyos@r14# set vpn openconnect network-settings push-route 100.64.22.0/24
[edit]
vyos@r14# commit
[ vpn openconnect ]
/usr/libexec/vyos/conf_mode/vpn_openconnect.py:32: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13
  from crypt import crypt, mksalt, METHOD_SHA512

[edit]
vyos@r14#
dmbaturin claimed this task.
dmbaturin added a subscriber: dmbaturin.

The OpenConnect script also uses sha512_crypt now.