[elbe-devel] [PATCH 37/37] Ignore DeprecationWarning from crypt

Benedikt Spranger b.spranger at linutronix.de
Wed Feb 7 15:29:04 CET 2024


crypt is deprecated in Python 3.11 and scheduled for removal in
Python 3.13. It claims passlib as recommended replacement. Using passlib
result in an error:

DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13
    from crypt import crypt as _crypt

The passlib project is aware of that error, but has no solution for it
right now. Ignore the error until a better solution is available.

Signed-off-by: Benedikt Spranger <b.spranger at linutronix.de>
---
 elbepack/db.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/elbepack/db.py b/elbepack/db.py
index b0145cc4..db46672e 100644
--- a/elbepack/db.py
+++ b/elbepack/db.py
@@ -17,7 +17,10 @@ from elbepack.dosunix import dos2unix
 from elbepack.elbeproject import ElbeProject
 from elbepack.elbexml import ElbeXML, ValidationMode
 
-from passlib.hash import pbkdf2_sha512
+try:
+    from passlib.hash import pbkdf2_sha512
+except DeprecationWarning:
+    pass
 
 from sqlalchemy import (
     Boolean,
-- 
2.43.0



More information about the elbe-devel mailing list