On Mon, 9 Feb 2004, Lennart Regebro wrote:
> From: "Dieter Maurer" <[EMAIL PROTECTED]>
> > Maybe, we have a memory corruption.
> > I have seen objects magically becoming "None" in
> > Python versions with memory corruption problems (Python 2.1.1).
> Also, loads of objects can become None when you do a refresh, because of
> some strange bug in the refresh support that has been there since it got
> integrated into the core and which nobody seems to understand.
It's actually a behavior of Python itself. When Zope's Refresh calls
Python's reload() builtin, reload() twiddles the old functions and methods
in such a way that all old globals are set to None. If you have the
misfortune of calling an old function or method, it's likely to fail in
the manner Dieter described. It is not memory corruption. It is the
Therefore, reload() only works if you can reliably sever all references to
functions or methods in the old module. Zapping the ZODB cache
accomplishes most of that, but there are still cases that bite people.
I think the only way to make Refresh work reliably is to create a special
kind of module that's explicitly refreshable. The module would obey some
special rules. Fortunately, that's just what Zope 3's persistent modules
will do. For now, you just have to be aware that Refresh is designed only
for simple products that do not create or use module-level registries.
Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists -