View | Details | Raw Unified | Return to bug 244546
Collapse All | Expand All

(-)lang/python37/Makefile (+1 lines)
Lines 3-8 Link Here
3
3
4
PORTNAME=	python
4
PORTNAME=	python
5
PORTVERSION=	${PYTHON_PORTVERSION}
5
PORTVERSION=	${PYTHON_PORTVERSION}
6
PORTREVISION=	1
6
CATEGORIES=	lang python
7
CATEGORIES=	lang python
7
MASTER_SITES=	PYTHON/ftp/python/${PORTVERSION}
8
MASTER_SITES=	PYTHON/ftp/python/${PORTVERSION}
8
PKGNAMESUFFIX=	${PYTHON_SUFFIX}
9
PKGNAMESUFFIX=	${PYTHON_SUFFIX}
(-)lang/python37/files/patch-Lib_ctypes_test_test__structures.py (+26 lines)
Line 0 Link Here
1
bpo-16575: Disabled checks for union types being passed by value. 
2
3
https://github.com/python/cpython/pull/17960
4
5
databases/grass7 wxPython gui needs this patch
6
Context here: https://trac.osgeo.org/grass/ticket/4015
7
8
--- Lib/ctypes/test/test_structures.py.orig	2020-03-01 17:40:30 UTC
9
+++ Lib/ctypes/test/test_structures.py
10
@@ -532,6 +532,7 @@ class StructureTestCase(unittest.TestCase):
11
             self.assertEqual(f2, [0x4567, 0x0123, 0xcdef, 0x89ab,
12
                                   0x3210, 0x7654, 0xba98, 0xfedc])
13
 
14
+    @unittest.skipIf(True, 'Test disabled for now - see bpo-16575/bpo-16576')
15
     def test_union_by_value(self):
16
         # See bpo-16575
17
 
18
@@ -612,7 +613,7 @@ class StructureTestCase(unittest.TestCase):
19
         self.assertEqual(test5.nested.an_int, 0)
20
         self.assertEqual(test5.another_int, 0)
21
 
22
-    #@unittest.skipIf('s390' in MACHINE, 'Test causes segfault on S390')
23
+    @unittest.skipIf(True, 'Test disabled for now - see bpo-16575/bpo-16576')
24
     def test_bitfield_by_value(self):
25
         # See bpo-16576
26
 
(-)lang/python37/files/patch-Modules___ctypes___ctypes.c (+41 lines)
Line 0 Link Here
1
bpo-16575: Disabled checks for union types being passed by value. 
2
3
https://github.com/python/cpython/pull/17960
4
5
databases/grass7 wxPython gui needs this patch
6
Context here: https://trac.osgeo.org/grass/ticket/4015
7
8
--- Modules/_ctypes/_ctypes.c.orig	2020-03-01 17:40:43 UTC
9
+++ Modules/_ctypes/_ctypes.c
10
@@ -2277,6 +2277,23 @@ converters_from_argtypes(PyObject *ob)
11
     for (i = 0; i < nArgs; ++i) {
12
         PyObject *tp = PyTuple_GET_ITEM(ob, i);
13
         PyObject *cnv;
14
+/*
15
+ *      The following checks, relating to bpo-16575 and bpo-16576, have been
16
+ *      disabled. The reason is that, although there is a definite problem with
17
+ *      how libffi handles unions (https://github.com/libffi/libffi/issues/33),
18
+ *      there are numerous libraries which pass structures containing unions
19
+ *      by values - especially on Windows but examples also exist on Linux
20
+ *      (https://bugs.python.org/msg359834).
21
+ *
22
+ *      It may not be possible to get proper support for unions and bitfields
23
+ *      until support is forthcoming in libffi, but for now, adding the checks
24
+ *      has caused problems in otherwise-working software, which suggests it
25
+ *      is better to disable the checks.
26
+ *
27
+ *      Although specific examples reported relate specifically to unions and
28
+ *      not bitfields, the bitfields check is also being disabled as a
29
+ *      precaution.
30
+
31
         StgDictObject *stgdict = PyType_stgdict(tp);
32
 
33
         if (stgdict != NULL) {
34
@@ -2304,6 +2321,7 @@ converters_from_argtypes(PyObject *ob)
35
                 return NULL;
36
             }
37
         }
38
+*/
39
         cnv = PyObject_GetAttrString(tp, "from_param");
40
         if (!cnv)
41
             goto argtypes_error_1;

Return to bug 244546