[Python-Dev] Codecs data (original) (raw)

M.-A. Lemburg mal@lemburg.com
Tue, 11 Feb 2003 23:51:07 +0100


Gustavo Niemeyer wrote:

I belive we have a problem in our current codecs implementation: it doesn't work for multiple interpreter states, because the data is currently statically allocated in codecs.c. That way, only the first interpreter is going to have the codecs lookup working. The following interpreters will try to cross the interpreter state boundary and use the lookup function from the first interpreter, issuing all kinds of weird errors.

One solution would be to store that data in the "sys" module (e.g. codecsearchpath, codecsearchcache, codecinited). Can you please advice on how to fix that? I'll be willing to provide a fix with the proposed solution.

Martin had the idea to put these globals (along with other similar globals) in the thread state structure. I believe that's the right approach or at least hints in the right direction (we don't want the globals to be per thread, but there doesn't seem to be a better place).

Also see: https://sourceforge.net/tracker/?func=detail&aid=663074&group_id=5470&atid=105470

-- Marc-Andre Lemburg eGenix.com

Professional Python Software directly from the Source (#1, Feb 11 2003)

Python/Zope Products & Consulting ... http://www.egenix.com/ mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/


Python UK 2003, Oxford: 49 days left EuroPython 2003, Charleroi, Belgium: 133 days left