mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
Fixed SF bug #663074. The codec system was using global static
variables to store internal data. As a result, any atempts to use the unicode system with multiple active interpreters, or successive interpreter executions, would fail. Now that information is stored into members of the PyInterpreterState structure.
This commit is contained in:
parent
821a0fc140
commit
5ddd4c3f77
5 changed files with 80 additions and 92 deletions
|
@ -49,6 +49,9 @@ PyInterpreterState_New(void)
|
|||
interp->sysdict = NULL;
|
||||
interp->builtins = NULL;
|
||||
interp->tstate_head = NULL;
|
||||
interp->codec_search_path = NULL;
|
||||
interp->codec_search_cache = NULL;
|
||||
interp->codec_error_registry = NULL;
|
||||
#ifdef HAVE_DLOPEN
|
||||
#ifdef RTLD_NOW
|
||||
interp->dlopenflags = RTLD_NOW;
|
||||
|
@ -75,6 +78,9 @@ PyInterpreterState_Clear(PyInterpreterState *interp)
|
|||
for (p = interp->tstate_head; p != NULL; p = p->next)
|
||||
PyThreadState_Clear(p);
|
||||
HEAD_UNLOCK();
|
||||
ZAP(interp->codec_search_path);
|
||||
ZAP(interp->codec_search_cache);
|
||||
ZAP(interp->codec_error_registry);
|
||||
ZAP(interp->modules);
|
||||
ZAP(interp->sysdict);
|
||||
ZAP(interp->builtins);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue