summaryrefslogtreecommitdiff
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorGustavo Niemeyer <gustavo@niemeyer.net>2003-03-19 00:35:36 +0000
committerGustavo Niemeyer <gustavo@niemeyer.net>2003-03-19 00:35:36 +0000
commit2ad397fb9d79a560a9831a40dcb95a4bf1a011d9 (patch)
treeb0335caead5476a70d92c52fa11c2260562910a6 /Python/pystate.c
parentbf081068fbdf9bbcce680d7ae80e5fc6cb46b0fd (diff)
downloadcpython-2ad397fb9d79a560a9831a40dcb95a4bf1a011d9.tar.gz
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.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index e200ece8b9..1139851c3c 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -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);