[mod_python] How to get mod_python's running version?

dharana dharana at dharana.net
Thu May 19 05:50:08 EDT 2005


Trying to do a "import mod_python" from an external script works so I should 
ask, wouldn't it nice to have a mod_python.version string with just the current 
version or isn't it a good idea?

The problem is I want to make sure if it's 3.2 or later (FileSession, 
php.parsestring bugfix et all) in the script so I can't use the hacks available 
on testhandler or vampire because I believe they don't differentiate that.

Nicolas Lehuen wrote:
> Depending on your configuration, the mod_python version number appears
> in your server identification string (this is configured by the
> ServerTokens directive in httpd.conf).
> 
> You can then get mod_python's version number by parsing the
> SERVER_SOFTWARE environment variable obtained by :
> 

ServerTokens Prod won't show them and as it's a configuration thing so I don't 
believe it's the best way to do it.

> req.add_common_vars()
> req.subprocess_env.get('SERVER_SOFTWARE')
> 
> Have a look at the upcoming testhandler which output a bunch of
> diagnostic information :
> 
> http://svn.apache.org/repos/asf/httpd/mod_python/trunk/lib/python/mod_python/testhandler.py
> 
> Regards,
> 

It all boils down to the question: do you consider a good idea to have the 
version string in mod_python.version for example?


-- 
dharana



More information about the Mod_python mailing list