[issue24747] ctypes silently truncates ints larger than C int

2021-02-26 Thread Eryk Sun
Change by Eryk Sun : -- type: -> behavior versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker ___

[issue24747] ctypes silently truncates ints larger than C int

2015-10-25 Thread Ivan Pozdeev
Ivan Pozdeev added the comment: I wouldn't call it so carved in stone: 1) The note at `ctypes.c_int' (https://docs.python.org/2/library/ctypes.html?highlight=c_int#ctypes.c_int) is meant for explicit conversion - since the entry is about using `c_int' is Python code, not converting something

[issue24747] ctypes silently truncates ints larger than C int

2015-08-04 Thread Christopher Meng
Changes by Christopher Meng cicku...@gmail.com: -- nosy: +Christopher Meng ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24747 ___ ___

[issue24747] ctypes silently truncates ints larger than C int

2015-07-29 Thread eryksun
eryksun added the comment: I think the window to change this is closed. Section 16.16.2.7 in the docs states that for c_int no overflow checking is done. I'm sure there's code that relies on that behavior, just as I'm sure there's code that relies on it for the default conversion. That said,

[issue24747] ctypes silently truncates ints larger than C int

2015-07-29 Thread Petr Viktorin
New submission from Petr Viktorin: A Python int larger than a C int but smaller than a C long is silently truncated to int when passed to a ctypes function without C type information attached. Ints longer than C long fail with an OverflowError; I believe the same should happen for numbers

[issue24747] ctypes silently truncates ints larger than C int

2015-07-29 Thread Petr Viktorin
Petr Viktorin added the comment: Originally found here: https://bugzilla.redhat.com/show_bug.cgi?id=1244261 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24747 ___