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 lemburg, mark.dickinson, stutzbach, vstinner
Date 2019-07-01.17:39:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1562002743.95.0.49076601863.issue37474@roundup.psfhosted.org>
In-reply-to
Content
Just after calling _PyRuntime_Initialize(), Py_Main() calls:

    /* 754 requires that FP exceptions run in "no stop" mode by default,
     * and until C vendors implement C99's ways to control FP exceptions,
     * Python requires non-stop mode.  Alas, some platforms enable FP
     * exceptions by default.  Here we disable them.
     */
#ifdef __FreeBSD__
    fedisableexcept(FE_OVERFLOW);
#endif

It's done before calling Py_Initialize(). So applications embedding Python don't call it. But "customized Python" which call the new Py_RunMain() with Py_InititializeFromConfig() will not call it neither.

I would like to know if this setup code should be moved into Py_Initialize()? Especially into the new PyConfig API:
https://docs.python.org/dev/c-api/init_config.html

PyConfig got 2 flags to control parameters which affect the whole process:

* configure_c_stdio
* configure_locale

What is the behavior on FreeBSD when fedisableexcept(FE_OVERFLOW) is not called?

Note: I'm not sure why this call is only needed on FreeBSD, but not on macOS, OpenBSD or NetBSD (operating systems close to FreeBSD).
History
Date User Action Args
2019-07-01 17:39:04vstinnersetrecipients: + vstinner, lemburg, mark.dickinson, stutzbach
2019-07-01 17:39:03vstinnersetmessageid: <1562002743.95.0.49076601863.issue37474@roundup.psfhosted.org>
2019-07-01 17:39:03vstinnerlinkissue37474 messages
2019-07-01 17:39:03vstinnercreate