[Zope-dev] Refresh makes all imported modules = None

Shane Hathaway shane@zope.com
Mon, 03 Jun 2002 09:36:41 -0400


William Trenker wrote:
> Lennart Regebro wrote:
> 
>> Suddenly when I refresh products it seems that all imported modules in 
>> the refreshed product are set to None, because after a refresh, 
>> anything I try to do always ends up with an error message like "None 
>> has no attribute foobar" or "None is not callable",
> 
> 
> I get this problem too (specifically, "None is not callable").  I've had 
> to solve it by brute force -- shutting down Zope and restarting.  (Zope 
> 2.5.1 (binary release, python 2.1, win32-x86), python 2.1.3, win32)  
> After the restart, the product works fine.

This happens when you create references to the product outside the 
product.  Most Zope products don't need to.  Those that do (like 
CallProfiler and other monkey patch products) should not be considered 
refreshable.

> I have searched the documentation and zope.org but am having trouble 
> finding the requirements for using Refresh (other than I know that the 
> product directory has to have a refresh.txt file in it).
> 
> Is it required that the product use the "new" method of product 
> initialization, i.e.:
> def initialize(context):
>         context.registerClass(

Are you working with products that use the old style?  Are they still 
around? ;-)

Shane