[Zope] Detect ZOPE version inside a product

Gabriel Genellina gagenellina@softlab.com.ar
Fri, 06 Dec 2002 18:17:45 -0300


At 10:05 6/12/2002 +0100, you wrote:

>>How could I detect the running Zope version inside a product?
>>I need to do that at the module level, in the initialization stage.
>
>I'm not sure if its wise to make decicions based on version numbers.
>You cant know if the user of your product has a highly patched
>version of zope which whould in fact allow her to run your
>product.
>
>I'd suggest to check for existence of methods and objects
>and wether they work as expected which are essential for
>your product. Provide the user with appropriate error
>messages if not.

Since version 2.6 Zope changes its working directory to /var, earlier 
versions didn't, and I had to know that path. As you noted, relying in the 
version information is not very safe. I'm using now 
sys.modules['__builtin__'].CLIENT_HOME, that's fine, I presume.


Gabriel Genellina
Softlab SRL