mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
lazy-load crypt which is a deprecated lib to avoid having DepreciationWarnings all over the place
This commit is contained in:
parent
1d734b5df5
commit
05ea37d694
1 changed files with 3 additions and 1 deletions
|
@ -20,7 +20,6 @@ import os
|
||||||
import re
|
import re
|
||||||
import pwd
|
import pwd
|
||||||
import grp
|
import grp
|
||||||
import crypt
|
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
import subprocess
|
import subprocess
|
||||||
|
@ -1453,6 +1452,9 @@ def _hash_user_password(password):
|
||||||
[3] https://www.safaribooksonline.com/library/view/practical-unix-and/0596003234/ch04s03.html
|
[3] https://www.safaribooksonline.com/library/view/practical-unix-and/0596003234/ch04s03.html
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# FIXME: 'crypt' is deprecated and slated for removal in Python 3.13
|
||||||
|
import crypt
|
||||||
|
|
||||||
char_set = string.ascii_uppercase + string.ascii_lowercase + string.digits + "./"
|
char_set = string.ascii_uppercase + string.ascii_lowercase + string.digits + "./"
|
||||||
salt = "".join([random.SystemRandom().choice(char_set) for x in range(16)])
|
salt = "".join([random.SystemRandom().choice(char_set) for x in range(16)])
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue