]> git.pld-linux.org Git - packages/apache-mod_python.git/commitdiff
- apache was dying during reload without import.patch
authorBartek Szady <bszx@bszx.eu>
Fri, 11 Nov 2016 20:41:42 +0000 (21:41 +0100)
committerBartek Szady <bszx@bszx.eu>
Fri, 11 Nov 2016 20:46:39 +0000 (21:46 +0100)
apache-mod_python.spec
import.patch [new file with mode: 0644]

index 4aa391db2112eb44c2d887e83239d8ba28215415..d5ee60730271a5c6bf8f0dd66ed2a6cfd98b20b4 100644 (file)
@@ -20,7 +20,7 @@ Summary(pl.UTF-8):    Wbudowany interpreter języka Python dla serwera WWW Apache
 Summary(sv.UTF-8):     En inbyggd Python-interpretator för webbservern Apache
 Name:          apache-mod_%{mod_name}
 Version:       3.5.0
-Release:       19
+Release:       20
 License:       Apache
 Group:         Networking/Daemons/HTTP
 Source0:       http://dist.modpython.org/dist/mod_%{mod_name}-%{version}.tgz
@@ -31,6 +31,7 @@ Patch0:               %{name}-httpd-not-needed.patch
 Patch1:                no-git.patch
 Patch2:                set-request-response-status.patch
 Patch3:                install.patch
+Patch4:                import.patch
 URL:           http://www.modpython.org/
 BuildRequires: apache-devel >= 2.0.52-7
 BuildRequires: apr-devel >= 1:1.0.0
@@ -239,6 +240,7 @@ prestandan jämfört med den traditionella CGI-metoden.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 %build
 %{__aclocal}
diff --git a/import.patch b/import.patch
new file mode 100644 (file)
index 0000000..defaa88
--- /dev/null
@@ -0,0 +1,36 @@
+commit 5bb5d6d0113f6bbd72966a5c1f3e6d40c2e9c8fd
+Author: Grisha Trubetskoy <grisha@modpython.org>
+Date:   Tue Dec 1 22:07:50 2015 -0500
+
+    Do not import site.py for the main interpreter. Fixes #46.
+
+diff --git a/src/mod_python.c b/src/mod_python.c
+index 8c33c04..7e0ef1e 100644
+--- a/src/mod_python.c
++++ b/src/mod_python.c
+@@ -775,8 +775,15 @@ static int python_init(apr_pool_t *p, apr_pool_t *ptemp,
+         /* disable user site directories */
+         Py_NoUserSiteDirectory = 1;
+-        /* initialze the interpreter */
++        /* Initialze the main interpreter. We do not want site.py to
++         * be imported because as of Python 2.7.9 it would cause a
++         * circular dependency related to _locale which breaks
++         * graceful restart so we set Py_NoSiteFlag to 1 just for this
++         * one time. (https://github.com/grisha/mod_python/issues/46)
++         */
++        Py_NoSiteFlag = 1;
+         Py_Initialize();
++        Py_NoSiteFlag = 0;
+ #ifdef WITH_THREAD
+         /* create and acquire the interpreter lock */
+@@ -2649,7 +2656,7 @@ static void PythonChildInitHandler(apr_pool_t *p, server_rec *s)
+      * problems as well. Thus disable cleanup of Python when
+      * child processes are being shutdown. (MODPYTHON-109)
+      *
+-    apr_pool_cleanup_register(p, NULL, python_finalize, apr_pool_cleanup_null);
++     * apr_pool_cleanup_register(p, NULL, python_finalize, apr_pool_cleanup_null);
+      */
+     /*
This page took 0.146035 seconds and 4 git commands to generate.