diff options
author | Graham Dumpleton <Graham.Dumpleton@gmail.com> | 2012-04-15 15:00:36 +1000 |
---|---|---|
committer | Graham Dumpleton <Graham.Dumpleton@gmail.com> | 2012-04-15 15:00:36 +1000 |
commit | 4e5f57c5242f62c28be667c760142690586df9c4 (patch) | |
tree | dccf23e8c1b21b7209fae00e74ccdaeebcb2cce6 | |
parent | f1949a5a2023fe8c6934edf860ad9287ac1e4faa (diff) | |
download | mod_wsgi-4e5f57c5242f62c28be667c760142690586df9c4.tar.gz |
Workaround problem in Python where it doesn't initialise codecs automatically for sub interpreters.
-rw-r--r-- | mod_wsgi.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -4600,6 +4600,17 @@ static InterpreterObject *newInterpreterObject(const char *name) } /* + * Force loading of codecs into interpreter. This has to be + * done as not otherwise done in sub interpreters and if not + * done, code running in sub interpreters can fail on some + * platforms if a unicode string is added in sys.path and an + * import then done. + */ + + item = PyCodec_Encoder("ascii"); + Py_XDECREF(item); + + /* * If running in daemon process, override as appropriate * the USER, USERNAME or LOGNAME environment variables * so that they match the user that the process is running |