diff --git a/pkgs/development/python-modules/ecdsa/default.nix b/pkgs/development/python-modules/ecdsa/default.nix index dd17b454ba69..cf8c64fb787d 100644 --- a/pkgs/development/python-modules/ecdsa/default.nix +++ b/pkgs/development/python-modules/ecdsa/default.nix @@ -34,6 +34,13 @@ buildPythonPackage (finalAttrs: { pytestCheckHook ]; + patches = [ + # Python update caused one of the tests to fail. A patch that fixes this + # has been submitted upstream, yet to be applied. + # https://github.com/tlsfuzzer/python-ecdsa/pull/371 + ./pr-371-fix-test-2026-05-23.patch + ]; + passthru.updateScript = gitUpdater { rev-prefix = "python-ecdsa-"; }; diff --git a/pkgs/development/python-modules/ecdsa/pr-371-fix-test-2026-05-23.patch b/pkgs/development/python-modules/ecdsa/pr-371-fix-test-2026-05-23.patch new file mode 100644 index 000000000000..90d25d7db525 --- /dev/null +++ b/pkgs/development/python-modules/ecdsa/pr-371-fix-test-2026-05-23.patch @@ -0,0 +1,30 @@ +From f8e0f3a0035b44fa2541e2c447ed1599f220c4b5 Mon Sep 17 00:00:00 2001 +From: Alexander Shadchin +Date: Thu, 9 Apr 2026 12:22:29 +0300 +Subject: [PATCH] Fix tests with new Python + +--- + src/ecdsa/der.py | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/src/ecdsa/der.py b/src/ecdsa/der.py +index 5d35d698..587d7852 100644 +--- a/src/ecdsa/der.py ++++ b/src/ecdsa/der.py +@@ -464,12 +464,11 @@ def unpem(pem): + if isinstance(pem, text_type): # pragma: no branch + pem = pem.encode() + ++ lines = (l.strip() for l in pem.split(b"\n")) + d = b"".join( +- [ +- l.strip() +- for l in pem.split(b"\n") +- if l and not l.startswith(b"-----") +- ] ++ l ++ for l in lines ++ if l and not l.startswith(b"-----") + ) + return base64.b64decode(d) +