Hi, attached is a backport to Python 2.2.2 of the patch that fixes bug: #663074: codec registry and Python embedding problem which is discussed here: http://sourceforge.net/tracker/index.php?func=detail&aid=663074&group_id=5470&atid=105470 If there will be a Python 2.2.3 release, I suggest this patch is applied. Currently, mod_python programs cannot use encodings, because mod_python is one of the (few?) programs that uses multiple subinterpreters. About the patch: it is a backport of Gustavo Niemeyer's patch for 2.3 CVS. I had to adapt it a little bit because in 2.2 there is no codec error registry. Greetings, Geert Jansen
Logged In: YES user_id=537938 Here is the patch. It is tested and verified to fix the problem by two people. I also verified that it passes the test suite.
Logged In: YES user_id=21627 This patch breaks binary compatibility, as it changes the layout of PyInterpreterState. We could reduce the risk of breakage by moving the new members at the end of the struct. Assigning to Guido for pronouncement: Should this a) be rejected? b) be accepted as is? (arguing that nobody uses the interpreter state, anyway) c) accepted with the proposed change (i.e. sizeof(PyInterpreterState) still changes, but the offset of the existing members doesn't).
Logged In: YES user_id=6380 (c) is okay with me. Since PyInterpreterState is always allocated by the Python core, I can't see how this could possibly break something.