summaryrefslogtreecommitdiff
path: root/mod_wsgi.c
diff options
context:
space:
mode:
Diffstat (limited to 'mod_wsgi.c')
-rw-r--r--mod_wsgi.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/mod_wsgi.c b/mod_wsgi.c
index d66e1dd..62e9b1a 100644
--- a/mod_wsgi.c
+++ b/mod_wsgi.c
@@ -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