mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-02 08:56:07 +00:00
fix(instances): no deprecated crypt module from Python 3.11
The root password hash for a shut-off VM used crypt_r where installed (Python 3.13) and fell back to the stdlib crypt, which Python 3.11 and 3.12 deprecate: `python -W error::DeprecationWarning manage.py check` failed there. crypt-r (the same module, it requires Python 3.11) is now installed from 3.11, and the module is chosen by the Python version; 3.10's crypt is not deprecated.
This commit is contained in:
parent
9d1cfede31
commit
f93860fbd2
2 changed files with 8 additions and 5 deletions
|
|
@ -23,4 +23,4 @@ python-socketio==5.18.1
|
||||||
segno==1.6.6
|
segno==1.6.6
|
||||||
websockify==0.13.0
|
websockify==0.13.0
|
||||||
whitenoise==6.12.0
|
whitenoise==6.12.0
|
||||||
crypt-r>=3.13.0; python_version >= "3.13"
|
crypt-r>=3.13.0; python_version >= "3.11"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,3 @@
|
||||||
try:
|
|
||||||
import crypt_r as crypt
|
|
||||||
except ImportError:
|
|
||||||
import crypt
|
|
||||||
import difflib
|
import difflib
|
||||||
import functools
|
import functools
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
@ -11,10 +7,17 @@ import os
|
||||||
import re
|
import re
|
||||||
import secrets
|
import secrets
|
||||||
import socket
|
import socket
|
||||||
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
from ipaddress import ip_address
|
from ipaddress import ip_address
|
||||||
|
|
||||||
|
# the stdlib crypt is deprecated from Python 3.11 and gone in 3.13: crypt_r is the same module
|
||||||
|
if sys.version_info >= (3, 11):
|
||||||
|
import crypt_r as crypt
|
||||||
|
else:
|
||||||
|
import crypt
|
||||||
|
|
||||||
from accounts.models import UserInstance, UserSSHKey
|
from accounts.models import UserInstance, UserSSHKey
|
||||||
from admin.decorators import superuser_only
|
from admin.decorators import superuser_only
|
||||||
from appsettings.models import AppSettings
|
from appsettings.models import AppSettings
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue