[issue24470] ctypes incorrect handling of long int on 64bits Linux
eryksun
report at bugs.python.org
Fri Jun 19 11:15:52 CEST 2015
eryksun added the comment:
It works for me:
>>> open('test.c', 'w').write('long test(long x) {return x;}')
>>> os.system('gcc -shared -fPIC -o test.so test.c')
0
>>> test = CDLL('./test.so').test
>>> test.restype = c_long
>>> test.argtypes = (c_long,)
>>> test(2**63-1) == 2**63-1
True
However, I used the correct attribute name, "argtypes". ctypes objects have dicts to allow setting arbitrary attribute names, so you won't get an AttributeError when setting "args" on a function pointer.
----------
nosy: +eryksun
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24470>
_______________________________________
More information about the Python-bugs-list
mailing list