➜

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.

作者 ncoghlan
收信人 Decorater, eric.snow, ncoghlan, serhiy.storchaka, vstinner
日期 2017-11-23.00:44:22
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1511397862.61.0.213398074469.issue32096@psf.upfronthosting.co.za>
In-reply-to
内容
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
历史
日期 用户 动作 参数
2017-11-23 00:44:22ncoghlan修改recipients: + ncoghlan, vstinner, eric.snow, serhiy.storchaka, Decorater
2017-11-23 00:44:22ncoghlan修改messageid: <1511397862.61.0.213398074469.issue32096@psf.upfronthosting.co.za>
2017-11-23 00:44:22ncoghlan链接issue32096 messages
2017-11-23 00:44:22ncoghlan创建