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 ncoghlan
Recipients Decorater, eric.snow, ncoghlan, serhiy.storchaka, vstinner
Date 2017-11-23.00:44:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1511397862.61.0.213398074469.issue32096@psf.upfronthosting.co.za>
In-reply-to
Content
Even the public implementation of PEP 432 is going to bound by the requirement to keep existing embedding logic working, and that's encapsulated in the new test Eric added in his PR:

    wchar_t *program = Py_DecodeLocale("spam", NULL);
    Py_SetProgramName(program);
    Py_Initialize();
    Py_Finalize();
    PyMem_RawFree(program);

So even if we were to revert the _PyRuntime.mem change in 3.7, we'd still face the same problem in 3.8, because we'd still be exposing the traditional configuration API - the new multi-step configuration API would be *optional* for folks that wanted to override the default settings more easily, rather than a backwards compatibility break with the previously supported way of doing things.

As a result, my preferred option is now to make exactly the promises we need to ensure that the above code works correctly, and then have Py_Initialize and Py_Finalize enforce those constraints:

* the public Py_Initialize API should fail if the memory allocators have already been set to something other than the default
* Py_Finalize should revert the memory allocators to their default setting
History
Date User Action Args
2017-11-23 00:44:22ncoghlansetrecipients: + ncoghlan, vstinner, eric.snow, serhiy.storchaka, Decorater
2017-11-23 00:44:22ncoghlansetmessageid: <1511397862.61.0.213398074469.issue32096@psf.upfronthosting.co.za>
2017-11-23 00:44:22ncoghlanlinkissue32096 messages
2017-11-23 00:44:22ncoghlancreate