STINNER Victor <victor.stin...@haypocalc.com> added the comment: The problem is in PyLong_FromDouble(): if (Py_IS_INFINITY(dval)) is evaluated as false, whereas dval *is* infinity. Possible causes:
- Py_IS_INFINITY is not defined as "# define Py_IS_INFINITY(X) isinf(X)" (issue with the pyconfig.h file?) - the compiler replaces isinf(X) by something else (!?) - isinf() is not called with the right argument (conversion between 32, 64 and/or 80 floats?) - issue with the FPU mode (unlikely because in your ctypes test, isinf(float("inf")) returns 1, and this test runs in the Python process) Try to run python in gdb. Set a breakpoint on isinf() (or on PyLong_FromDouble() and use step by step) to check that the function is really called, and called with the "right" argument. You may also try to replace Py_IS_INFINITY(dval) directly by isinf(dval) (or simply if(1) :-)) in PyLong_FromDouble(). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12589> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com