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 vstinner
Date 2019-03-20.15:32:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1553095961.34.0.427301322893.issue36301@roundup.psfhosted.org>
In-reply-to
Content
In term of API, we get something like:

    _PyInitError err;

    _PyPreConfig preconfig = _PyPreConfig_INIT;
    preconfig.utf8_mode = 1;
    preconfig.allocator = "malloc";

    _PyInitError err = _Py_PreInitializeFromPreConfig(&preconfig);
    if (_Py_INIT_FAILED(err)) {
        _Py_ExitInitError(err);
    }

    /* PyMem_RawMalloc and Py_DecodeLocale can now be used */

    _PyCoreConfig config = _PyCoreConfig_INIT;
    config.user_site_directory = 0;

    err = _Py_InitializeFromConfig(&config);
    if (_Py_INIT_FAILED(err)) {
        _Py_ExitInitError(err);
    }

    /* ... use Python ... */

    Py_Finalize();

    /* Note: no need to "free" preconfig nor config memory, they use constants */
History
Date User Action Args
2019-03-20 15:32:41vstinnersetrecipients: + vstinner
2019-03-20 15:32:41vstinnersetmessageid: <1553095961.34.0.427301322893.issue36301@roundup.psfhosted.org>
2019-03-20 15:32:41vstinnerlinkissue36301 messages
2019-03-20 15:32:41vstinnercreate