Edgewall Software

Changes between Version 20 and Version 21 of TracModPython


Ignore:
Timestamp:
Mar 16, 2005, 8:52:58 PM (19 years ago)
Author:
jkp@…
Comment:

Added OS X patch

Legend:

Unmodified
Added
Removed
Modified
  • TracModPython

    v20 v21  
    183183or apply [http://www.dscpl.com.au/projects/vampire/PATCHES this patch] to mod_python.
    184184
    185 Also note another potential issue where Apache will return a 500 error regardless of what you try to do with mod_python.  If you see this, make sure you do not restart using apachectl restart, but instead stop and start the server again.   This solves the issue.
     185Also note that there is an error in the module when you build it from source.  Basically an unpatched version will not respond correctly to the 'apachectl restart' command.  If you issue this command on an unpatched module your client will receive a 500 error from apache.  The patch needed to fix this problem is included below:
     186
     187{{{
     188*** mod_python.c.dist   Tue May 29 06:00:41 2001
     189--- mod_python.c        Thu Aug  5 13:21:22 2004
     190***************
     191*** 260,265 ****
     192--- 260,268 ----
     193
     194      char buff[255];
     195
     196+     /* fudge for Mac OS X with Apache where Py_IsInitialized() broke */
     197+     static int initialized = 0;
     198+
     199      /* pool given to us in ChildInit. We use it for
     200         server.register_cleanup() */
     201      pool *child_init_pool = NULL;
     202***************
     203*** 272,279 ****
     204      ap_add_version_component(buff);
     205
     206      /* initialize global Python interpreter if necessary */
     207!     if (! Py_IsInitialized())
     208      {
     209
     210        /* initialze the interpreter */
     211        Py_Initialize();
     212--- 275,283 ----
     213      ap_add_version_component(buff);
     214
     215      /* initialize global Python interpreter if necessary */
     216!     if (initialized == 0 || ! Py_IsInitialized())
     217      {
     218+         initialized = 1;
     219
     220        /* initialze the interpreter */
     221        Py_Initialize();
     222}}}
    186223
    187224----