mirror of
https://github.com/python/cpython.git
synced 2025-08-29 13:15:11 +00:00
Issue 3723: Fixed initialization of subinterpreters
The patch fixes several issues with Py_NewInterpreter as well as the demo for multiple subinterpreters. Most of the patch was written by MvL with help from Benjamin, Amaury and me. Graham Dumpleton has verified that this patch fixes an issue with mod_wsgi.
This commit is contained in:
parent
5833a2f6fd
commit
6a27efa2d3
9 changed files with 43 additions and 3 deletions
|
@ -1346,6 +1346,19 @@ PyObject *PyUnicode_AsEncodedString(PyObject *unicode,
|
|||
#endif
|
||||
else if (strcmp(encoding, "ascii") == 0)
|
||||
return PyUnicode_AsASCIIString(unicode);
|
||||
/* During bootstrap, we may need to find the encodings
|
||||
package, to load the file system encoding, and require the
|
||||
file system encoding in order to load the encodings
|
||||
package.
|
||||
|
||||
Break out of this dependency by assuming that the path to
|
||||
the encodings module is ASCII-only. XXX could try wcstombs
|
||||
instead, if the file system encoding is the locale's
|
||||
encoding. */
|
||||
else if (Py_FileSystemDefaultEncoding &&
|
||||
strcmp(encoding, Py_FileSystemDefaultEncoding) == 0 &&
|
||||
!PyThreadState_GET()->interp->codecs_initialized)
|
||||
return PyUnicode_AsASCIIString(unicode);
|
||||
}
|
||||
|
||||
/* Encode via the codec registry */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue