Peter Bengtsson wrote at 2006-8-18 18:53 +0100: > ... >One last odd clue, when I refresh my product (eg. MyProduct) in zope >2.9.4, actual something happens. My product is very very simple and >it's one main class has a method called index_html() that looks like >this: > > >from DateTime import DateTime > def index_html(self, REQUEST, RESPONSE): > """ doc str """ > return str(DateTime()) > >It works fine. After I manually refresh the product through the >Control_Panel, I get an error in index_html() because now 'DateTime' >has become None and thus can't be called with DateTime(). >Does that help you help me?
Global variables apparently becoming "None" is a sign that you are using an old (pre refresh) version of a function ("index_html" in your case). When a module is released, some Python magic arranges that all its variables are rebound to "None". When the function accesses one of its globals, it then appears as "None". If you have accessed the "index_html" via a persistent instance, then the "resetCaches" seems not to have done what we expect (it should have caused the connection cache to be dropped and a new instance loaded from the storage with the new class definition). -- Dieter _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )