Package: release.debian.org
Severity: normal
Tags: trixie
X-Debbugs-Cc: [email protected], [email protected]
Control: affects -1 + src:python-pyspnego
User: [email protected]
Usertags: pu

[ Reason ]
This update adds a few LoC patch to address a deprecation warning when importing
this python module.

[ Impact ]
The update specifically fixes the issue when using it with ansible, as it
creates 4 lines of deprecation warning per task (See #1123071)

[ Tests ]
I have manually tested the binary package and it fixes the issue at hand.

[ Risks ]
The code change is trivial and contains a patch that already has been merged
upstream. Special care has been taken that it still works with the same
python-cryptography as before by providing a fallback.

[ Checklist ]
  [x] *all* changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in (old)stable
  [x] the issue is verified as fixed in unstable

[ Changes ]
The quilt patch is trivial enough to be included inline:

--- a/src/spnego/_ntlm_raw/crypto.py
+++ b/src/spnego/_ntlm_raw/crypto.py
@@ -20,7 +20,15 @@ import struct
 import typing

 from cryptography.hazmat.backends import default_backend
-from cryptography.hazmat.primitives.ciphers import Cipher, algorithms
+from cryptography.hazmat.primitives.ciphers import Cipher
+
+try:
+    # cryptography 43.0.0 and later moved ARC4 to decrepit
+    from cryptography.hazmat.decrepit.ciphers import algorithms
+except ImportError:
+    from cryptography.hazmat.primitives.ciphers import (  # type: 
ignore[no-redef]
+        algorithms,
+    )


[ Other info ]
zigo (the maintainer) has given explicit consent for me to do the s-p-u, see
#1123071#15.
diff -Nru python-pyspnego-0.10.2/debian/changelog 
python-pyspnego-0.10.2/debian/changelog
--- python-pyspnego-0.10.2/debian/changelog     2024-05-14 11:46:13.000000000 
+0200
+++ python-pyspnego-0.10.2/debian/changelog     2026-01-09 15:35:06.000000000 
+0100
@@ -1,3 +1,10 @@
+python-pyspnego (0.10.2-2+deb13u1) trixie; urgency=medium
+
+  * Non-maintainer upload with permission by the maintainer (#1123071#15)
+  * Fix deprecation warning (Closes: #1123071)
+
+ -- Lee Garrett <[email protected]>  Fri, 09 Jan 2026 15:35:06 +0100
+
 python-pyspnego (0.10.2-2) unstable; urgency=medium
 
   * Rebuilt source-only.
diff -Nru 
python-pyspnego-0.10.2/debian/patches/0001-Fix-deprecation-warning.patch 
python-pyspnego-0.10.2/debian/patches/0001-Fix-deprecation-warning.patch
--- python-pyspnego-0.10.2/debian/patches/0001-Fix-deprecation-warning.patch    
1970-01-01 01:00:00.000000000 +0100
+++ python-pyspnego-0.10.2/debian/patches/0001-Fix-deprecation-warning.patch    
2026-01-09 15:33:35.000000000 +0100
@@ -0,0 +1,29 @@
+Description: Fix deprecation warning on import
+Author: Jordan Borean <[email protected]>
+Origin: backport, https://github.com/jborean93/pyspnego/pull/87
+Forwarded: not-needed
+Reviewed-by: Lee Garrett <[email protected]>
+Last-Update: 2026-01-09
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+diff --git a/src/spnego/_ntlm_raw/crypto.py b/src/spnego/_ntlm_raw/crypto.py
+index fe1135a..39661f0 100644
+--- a/src/spnego/_ntlm_raw/crypto.py
++++ b/src/spnego/_ntlm_raw/crypto.py
+@@ -20,7 +20,15 @@ import struct
+ import typing
+ 
+ from cryptography.hazmat.backends import default_backend
+-from cryptography.hazmat.primitives.ciphers import Cipher, algorithms
++from cryptography.hazmat.primitives.ciphers import Cipher
++
++try:
++    # cryptography 43.0.0 and later moved ARC4 to decrepit
++    from cryptography.hazmat.decrepit.ciphers import algorithms
++except ImportError:
++    from cryptography.hazmat.primitives.ciphers import (  # type: 
ignore[no-redef]
++        algorithms,
++    )
+ 
+ from spnego._ntlm_raw.des import DES
+ from spnego._ntlm_raw.md4 import md4
diff -Nru python-pyspnego-0.10.2/debian/patches/series 
python-pyspnego-0.10.2/debian/patches/series
--- python-pyspnego-0.10.2/debian/patches/series        1970-01-01 
01:00:00.000000000 +0100
+++ python-pyspnego-0.10.2/debian/patches/series        2026-01-09 
15:33:35.000000000 +0100
@@ -0,0 +1 @@
+0001-Fix-deprecation-warning.patch

Reply via email to