Message359998
> With Python 3.7.6 this raises an exception at the ctypes.CFUNCTYPE()
> call with
> ...
> TypeError: item 1 in _argtypes_ passes a struct/union with a bitfield
> by value, which is unsupported.
I cannot reproduce the problem as stated in 3.7.6 in Windows. The TypeError only occurs if I use the struct type directly in argtypes, not a pointer to the struct type. For example:
>>> class A(ctypes.Structure):
... _fields_ = (('x', ctypes.c_uint, 1),)
>>> class P_A(ctypes._Pointer):
... _type_ = A
...
allowed:
>>> class FP_P_A(ctypes._CFuncPtr):
... _flags_ = ctypes._FUNCFLAG_CDECL
... _argtypes_ = (P_A,)
disallowed:
>>> class FP_A(ctypes._CFuncPtr):
... _flags_ = ctypes._FUNCFLAG_CDECL
... _argtypes_ = (A,)
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: item 1 in _argtypes_ passes a struct/union with a bitfield by value, which is unsupported.
This seems rights to me. There is no problem passing a pointer as a function parameter. |
|
Date |
User |
Action |
Args |
2020-01-14 21:00:11 | eryksun | set | recipients:
+ eryksun, vinay.sajip, cheryl.sabella, Matthew Newville |
2020-01-14 21:00:11 | eryksun | set | messageid: <1579035611.51.0.124590726212.issue39295@roundup.psfhosted.org> |
2020-01-14 21:00:11 | eryksun | link | issue39295 messages |
2020-01-14 21:00:11 | eryksun | create | |
|