This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients landry, mark.dickinson, rpointel, vstinner
Date 2011-07-22.10:08:11
SpamBayes Score 2.8132772e-09
Marked as misclassified No
Message-id <1311329292.48.0.726366081785.issue12589@psf.upfronthosting.co.za>
In-reply-to
Content
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().
History
Date User Action Args
2011-07-22 10:08:12vstinnersetrecipients: + vstinner, mark.dickinson, rpointel, landry
2011-07-22 10:08:12vstinnersetmessageid: <1311329292.48.0.726366081785.issue12589@psf.upfronthosting.co.za>
2011-07-22 10:08:11vstinnerlinkissue12589 messages
2011-07-22 10:08:11vstinnercreate