FreeBSD Bugzilla – Attachment 212081 Details for
Bug 244546
lang/python37: Backport pull request 17960 (Fix for broken ctypes)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
python37 patch for bpo-16575
python37_patch_bug_bpo-16575 (text/plain), 3.73 KB, created by
Loïc Bartoletti
on 2020-03-01 19:21:10 UTC
(
hide
)
Description:
python37 patch for bpo-16575
Filename:
MIME Type:
Creator:
Loïc Bartoletti
Created:
2020-03-01 19:21:10 UTC
Size:
3.73 KB
patch
obsolete
>Index: lang/python37/Makefile >=================================================================== >--- lang/python37/Makefile (révision 527598) >+++ lang/python37/Makefile (copie de travail) >@@ -3,6 +3,7 @@ > > PORTNAME= python > PORTVERSION= ${PYTHON_PORTVERSION} >+PORTREVISION= 1 > CATEGORIES= lang python > MASTER_SITES= PYTHON/ftp/python/${PORTVERSION} > PKGNAMESUFFIX= ${PYTHON_SUFFIX} >Index: lang/python37/files/patch-Lib_ctypes_test_test__structures.py >=================================================================== >--- lang/python37/files/patch-Lib_ctypes_test_test__structures.py (nonexistent) >+++ lang/python37/files/patch-Lib_ctypes_test_test__structures.py (copie de travail) >@@ -0,0 +1,26 @@ >+bpo-16575: Disabled checks for union types being passed by value. >+ >+https://github.com/python/cpython/pull/17960 >+ >+databases/grass7 wxPython gui needs this patch >+Context here: https://trac.osgeo.org/grass/ticket/4015 >+ >+--- Lib/ctypes/test/test_structures.py.orig 2020-03-01 17:40:30 UTC >++++ Lib/ctypes/test/test_structures.py >+@@ -532,6 +532,7 @@ class StructureTestCase(unittest.TestCase): >+ self.assertEqual(f2, [0x4567, 0x0123, 0xcdef, 0x89ab, >+ 0x3210, 0x7654, 0xba98, 0xfedc]) >+ >++ @unittest.skipIf(True, 'Test disabled for now - see bpo-16575/bpo-16576') >+ def test_union_by_value(self): >+ # See bpo-16575 >+ >+@@ -612,7 +613,7 @@ class StructureTestCase(unittest.TestCase): >+ self.assertEqual(test5.nested.an_int, 0) >+ self.assertEqual(test5.another_int, 0) >+ >+- #@unittest.skipIf('s390' in MACHINE, 'Test causes segfault on S390') >++ @unittest.skipIf(True, 'Test disabled for now - see bpo-16575/bpo-16576') >+ def test_bitfield_by_value(self): >+ # See bpo-16576 >+ >Index: lang/python37/files/patch-Modules___ctypes___ctypes.c >=================================================================== >--- lang/python37/files/patch-Modules___ctypes___ctypes.c (nonexistent) >+++ lang/python37/files/patch-Modules___ctypes___ctypes.c (copie de travail) >@@ -0,0 +1,41 @@ >+bpo-16575: Disabled checks for union types being passed by value. >+ >+https://github.com/python/cpython/pull/17960 >+ >+databases/grass7 wxPython gui needs this patch >+Context here: https://trac.osgeo.org/grass/ticket/4015 >+ >+--- Modules/_ctypes/_ctypes.c.orig 2020-03-01 17:40:43 UTC >++++ Modules/_ctypes/_ctypes.c >+@@ -2277,6 +2277,23 @@ converters_from_argtypes(PyObject *ob) >+ for (i = 0; i < nArgs; ++i) { >+ PyObject *tp = PyTuple_GET_ITEM(ob, i); >+ PyObject *cnv; >++/* >++ * The following checks, relating to bpo-16575 and bpo-16576, have been >++ * disabled. The reason is that, although there is a definite problem with >++ * how libffi handles unions (https://github.com/libffi/libffi/issues/33), >++ * there are numerous libraries which pass structures containing unions >++ * by values - especially on Windows but examples also exist on Linux >++ * (https://bugs.python.org/msg359834). >++ * >++ * It may not be possible to get proper support for unions and bitfields >++ * until support is forthcoming in libffi, but for now, adding the checks >++ * has caused problems in otherwise-working software, which suggests it >++ * is better to disable the checks. >++ * >++ * Although specific examples reported relate specifically to unions and >++ * not bitfields, the bitfields check is also being disabled as a >++ * precaution. >++ >+ StgDictObject *stgdict = PyType_stgdict(tp); >+ >+ if (stgdict != NULL) { >+@@ -2304,6 +2321,7 @@ converters_from_argtypes(PyObject *ob) >+ return NULL; >+ } >+ } >++*/ >+ cnv = PyObject_GetAttrString(tp, "from_param"); >+ if (!cnv) >+ goto argtypes_error_1;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 244546
: 212081