guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: gnu: python-pyopenssl: Fix test failure on 32-bit platforms.


From: Marius Bakke
Subject: 01/01: gnu: python-pyopenssl: Fix test failure on 32-bit platforms.
Date: Fri, 7 Jul 2017 12:47:29 -0400 (EDT)

mbakke pushed a commit to branch master
in repository guix.

commit d28f90bed95e63f7c066e242549aa25a09276750
Author: Marius Bakke <address@hidden>
Date:   Fri Jul 7 18:28:45 2017 +0200

    gnu: python-pyopenssl: Fix test failure on 32-bit platforms.
    
    * gnu/packages/patches/python-pyopenssl-17.1.0-test-overflow.patch: New 
file.
    * gnu/local.mk (dist_patch_DATA): Add it.
    * gnu/packages/python.scm (python-pyopenssl)[source]: Use it.
---
 gnu/local.mk                                       |  1 +
 .../python-pyopenssl-17.1.0-test-overflow.patch    | 36 ++++++++++++++++++++++
 gnu/packages/python.scm                            |  2 ++
 3 files changed, 39 insertions(+)

diff --git a/gnu/local.mk b/gnu/local.mk
index 6f6db6d..8e4af46 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -958,6 +958,7 @@ dist_patch_DATA =                                           
\
   %D%/packages/patches/python-pycrypto-CVE-2013-7459.patch     \
   %D%/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \
   %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch \
+  %D%/packages/patches/python-pyopenssl-17.1.0-test-overflow.patch     \
   %D%/packages/patches/python2-subprocess32-disable-input-test.patch   \
   %D%/packages/patches/qemu-CVE-2017-7493.patch                        \
   %D%/packages/patches/qemu-CVE-2017-8112.patch                        \
diff --git a/gnu/packages/patches/python-pyopenssl-17.1.0-test-overflow.patch 
b/gnu/packages/patches/python-pyopenssl-17.1.0-test-overflow.patch
new file mode 100644
index 0000000..06b2f4f
--- /dev/null
+++ b/gnu/packages/patches/python-pyopenssl-17.1.0-test-overflow.patch
@@ -0,0 +1,36 @@
+Resolves a test failure on 32-bit platforms.
+
+https://github.com/pyca/pyopenssl/issues/657
+
+Patch copied from upstream source repository:
+
+https://github.com/pyca/pyopenssl/commit/ecc0325479c0d5c5f2ca88b4550e87cdb59d6c95
+
+From ecc0325479c0d5c5f2ca88b4550e87cdb59d6c95 Mon Sep 17 00:00:00 2001
+From: Alex Gaynor <address@hidden>
+Date: Thu, 6 Jul 2017 22:14:44 -0400
+Subject: [PATCH] Fixed #657 -- handle OverflowErrors on large allocation
+ requests
+
+---
+ tests/test_rand.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tests/test_rand.py b/tests/test_rand.py
+index bdd3af08..6adf72a1 100644
+--- a/tests/test_rand.py
++++ b/tests/test_rand.py
+@@ -32,10 +32,10 @@ def test_bytes_wrong_args(self, args):
+ 
+     def test_insufficient_memory(self):
+         """
+-        `OpenSSL.rand.bytes` raises `MemoryError` if more bytes are requested
+-        than will fit in memory.
++        `OpenSSL.rand.bytes` raises `MemoryError` or `OverflowError` if more
++        bytes are requested than will fit in memory.
+         """
+-        with pytest.raises(MemoryError):
++        with pytest.raises((MemoryError, OverflowError)):
+             rand.bytes(sys.maxsize)
+ 
+     def test_bytes(self):
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 2a7b517..d110a1c 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -7464,6 +7464,8 @@ message digests and key derivation functions.")
      (origin
        (method url-fetch)
        (uri (pypi-uri "pyOpenSSL" version))
+       (patches
+        (search-patches "python-pyopenssl-17.1.0-test-overflow.patch"))
        (sha256
         (base32
          "0qwmqhfsq84ydir9dz273ypmlcvs7v71m1jns0sd4k0h6lfsa82s"))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]