[issue24470] ctypes incorrect handling of long int on 64bits Linux
Marco Clemencic added the comment: Hi, apologies for the very late answer, but I just discovered that the mails got flagged as spam :( In any case, I do not know where I got this args from, but I can confirm that the problem is just a bug on my side. Thanks Marco -- resolution: - not a bug status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24470 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24470] ctypes incorrect handling of long int on 64bits Linux
Terry J. Reedy added the comment: Thank you for following up on this. -- stage: - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24470 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24470] ctypes incorrect handling of long int on 64bits Linux
Terry J. Reedy added the comment: Should this then be closed as not a bug? -- nosy: +terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24470 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24470] ctypes incorrect handling of long int on 64bits Linux
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 rep...@bugs.python.org http://bugs.python.org/issue24470 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com