summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-m2crypto/0001-fix-allow-64-bit-time_t-on-32-bit-systems-in-test_is.patch
diff options
context:
space:
mode:
authorHaixiao Yan <haixiao.yan.cn@windriver.com>2025-11-03 21:56:44 +0800
committerKhem Raj <raj.khem@gmail.com>2025-11-04 16:52:46 -0800
commit076217856e246a9eed9e8bafafa4876f70980860 (patch)
tree93820cd22f19acf1f998e12105e0f0b2b1033ef4 /meta-python/recipes-devtools/python/python3-m2crypto/0001-fix-allow-64-bit-time_t-on-32-bit-systems-in-test_is.patch
parentc9510a21cc40b0e736b14a6fca60c73d6fb4f9f1 (diff)
downloadmeta-openembedded-076217856e246a9eed9e8bafafa4876f70980860.tar.gz
python3-m2crypto: correct struct packing on 32-bit with _TIME_BITS=64
Fixes: # python3 -munittest -v test_ssl.MiscSSLClientTestCase.test_server_simple_timeouts test_server_simple_timeouts (test_ssl.MiscSSLClientTestCase.test_server_simple_timeouts) ... ERROR ====================================================================== ERROR: test_server_simple_timeouts (test_ssl.MiscSSLClientTestCase.test_server_simple_timeouts) ---------------------------------------------------------------------- Traceback (most recent call last): File "/opt/python3-m2crypto/tests/test_ssl.py", line 474, in test_server_simple_timeouts s.set_socket_read_timeout(SSL.timeout()) ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^ File "/usr/lib/python3.13/site-packages/M2Crypto/SSL/Connection.py", line 680, in set_socket_read_timeout self.socket.setsockopt( ~~~~~~~~~~~~~~~~~~~~~~^ socket.SOL_SOCKET, socket.SO_RCVTIMEO, timeo.pack() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ OSError: [Errno 22] Invalid argument Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-m2crypto/0001-fix-allow-64-bit-time_t-on-32-bit-systems-in-test_is.patch')
-rw-r--r--meta-python/recipes-devtools/python/python3-m2crypto/0001-fix-allow-64-bit-time_t-on-32-bit-systems-in-test_is.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-m2crypto/0001-fix-allow-64-bit-time_t-on-32-bit-systems-in-test_is.patch b/meta-python/recipes-devtools/python/python3-m2crypto/0001-fix-allow-64-bit-time_t-on-32-bit-systems-in-test_is.patch
new file mode 100644
index 0000000000..d49950074f
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-m2crypto/0001-fix-allow-64-bit-time_t-on-32-bit-systems-in-test_is.patch
@@ -0,0 +1,40 @@
1From d123b4ddce99c44f2c290fb3d6cc887de98778e6 Mon Sep 17 00:00:00 2001
2From: Haixiao Yan <haixiao.yan.cn@windriver.com>
3Date: Wed, 22 Oct 2025 15:23:56 +0800
4Subject: [PATCH 1/2] fix: allow 64-bit time_t on 32-bit systems in
5 test_is32bit
6
7Some modern 32-bit Linux systems (e.g. with glibc >= 2.34 or musl time64 ABI)
8use 64-bit time_t by default when _TIME_BITS=64 is enabled. The original test
9assumed time_t was always 32-bit on 32-bit architectures, which is no longer
10true.
11
12Relax the check to accept both 32-bit and 64-bit time_t values:
13
14 self.assertIn(bit32, (32, 64))
15
16This makes the test compatible with both legacy and time64 ABIs.
17
18Upstream-Status: Backport [https://gitlab.com/m2crypto/m2crypto/-/commit/818c3dfda6ea]
19
20Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com>
21---
22 tests/test_util.py | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
25diff --git a/tests/test_util.py b/tests/test_util.py
26index e925d03b090c..233fb7a099d9 100644
27--- a/tests/test_util.py
28+++ b/tests/test_util.py
29@@ -26,7 +26,7 @@ class UtilTestCase(unittest.TestCase):
30 not in ["true", "1", "yes"]
31 )
32 ):
33- self.assertEqual(bit32, 32)
34+ self.assertIn(bit32, (32, 64))
35 else:
36 self.assertNotEqual(bit32, 32)
37 self.assertIsInstance(bit32, int)
38--
392.34.1
40