diff Python/pystate.c @ 28325:850626d47574 legacy-trunk

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.
author Gustavo Niemeyer <gustavo@niemeyer.net>
date Wed, 19 Mar 2003 00:35:36 +0000
parents 4b99a701defe
children 4f0b7acffc7d
line wrap: on
line diff
--- a/Python/pystate.c	Tue Mar 18 18:48:17 2003 +0000
+++ b/Python/pystate.c	Wed Mar 19 00:35:36 2003 +0000
@@ -49,6 +49,9 @@
 		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 @@
 	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);