[Python-Dev] Python initialization and embedded Python

Nick Coghlan ncoghlan at gmail.com
Mon Nov 20 01:54:22 EST 2017

On 19 November 2017 at 18:52, Victor Stinner <victor.stinner at gmail.com> wrote:
> Maybe we can find a compromise: revert the change on memory allocators. They
> are too special to require to call PyRuntime_Init().
> Currently, you cannot call PyMem_SetAllocators() before PyRuntime_Init().

At least the raw allocators, anyway - that way, the developer facing
documentation/comments can just say that the raw allocators can't have
any prerequisites that aren't shared by regular
malloc/calloc/realloc/free calls.

If that's enough to get Py_DecodeLocale working again prior to
_PyRuntime_Init(), then I'd suggest officially adding that to the
"must work prior to Py_Initialize" list, otherwise we can re-examine
it based on whatever's still broken after reverting the raw allocator


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list