]>
Commit | Line | Data |
---|---|---|
97e00cf4 JR |
1 | diff -urNp -x '*.orig' mod_python-3.5.0.org/src/mod_python.c mod_python-3.5.0/src/mod_python.c |
2 | --- mod_python-3.5.0.org/src/mod_python.c 2013-11-12 04:21:34.000000000 +0100 | |
3 | +++ mod_python-3.5.0/src/mod_python.c 2021-03-02 22:05:35.833364242 +0100 | |
4 | @@ -772,8 +772,15 @@ static int python_init(apr_pool_t *p, ap | |
5 | { | |
6 | initialized = 1; | |
7263950d BS |
7 | |
8 | - /* initialze the interpreter */ | |
9 | + /* Initialze the main interpreter. We do not want site.py to | |
10 | + * be imported because as of Python 2.7.9 it would cause a | |
11 | + * circular dependency related to _locale which breaks | |
12 | + * graceful restart so we set Py_NoSiteFlag to 1 just for this | |
13 | + * one time. (https://github.com/grisha/mod_python/issues/46) | |
14 | + */ | |
15 | + Py_NoSiteFlag = 1; | |
16 | Py_Initialize(); | |
17 | + Py_NoSiteFlag = 0; | |
18 | ||
19 | #ifdef WITH_THREAD | |
20 | /* create and acquire the interpreter lock */ | |
97e00cf4 | 21 | @@ -2646,7 +2653,7 @@ static void PythonChildInitHandler(apr_p |
7263950d BS |
22 | * problems as well. Thus disable cleanup of Python when |
23 | * child processes are being shutdown. (MODPYTHON-109) | |
24 | * | |
25 | - apr_pool_cleanup_register(p, NULL, python_finalize, apr_pool_cleanup_null); | |
26 | + * apr_pool_cleanup_register(p, NULL, python_finalize, apr_pool_cleanup_null); | |
27 | */ | |
28 | ||
29 | /* |