]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-42882: _PyRuntimeState_Init() leaves unicode next_index unchanged (GH-24193)
authorVictor Stinner <vstinner@python.org>
Tue, 12 Jan 2021 09:29:45 +0000 (10:29 +0100)
committerGitHub <noreply@github.com>
Tue, 12 Jan 2021 09:29:45 +0000 (10:29 +0100)
commit44bf57aca627bd11a08b12fe4e4b6a0e1d268862
tree8a4fd654a088bf39e0cc1cf21f799c05ee5b2bd3
parentfb35fa49d192368e94ffec09c092260ed0fea2e1
bpo-42882: _PyRuntimeState_Init() leaves unicode next_index unchanged (GH-24193)

Fix the _PyUnicode_FromId() function (_Py_IDENTIFIER(var) API) when
Py_Initialize() / Py_Finalize() is called multiple times:
preserve _PyRuntime.unicode_ids.next_index value.

Use _PyRuntimeState_INIT macro instead memset(0) to reset
_PyRuntimeState members to zero.
Include/internal/pycore_runtime.h
Misc/NEWS.d/next/Core and Builtins/2021-01-11-17-58-52.bpo-42882.WfTdfg.rst [new file with mode: 0644]
Python/pystate.c