[Zope-dev] The refresh "bug".

Lennart Regebro regebro at nuxeo.com
Tue Feb 10 05:08:47 EST 2004


From: "Dieter Maurer" <dieter at handshake.de>
> Lennart Regebro wrote at 2004-2-9 11:04 +0100:
> >From: "Dieter Maurer" <dieter at handshake.de>
> >> ... objects turned into None ...
> >
> >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.
>
> I think I understand it.
>
>    When Python delete a module it lets the objects in the module become
>    None.
>
>    Refresh works by deleting the product modules from "sys.modules"
>    and then forcing the ZODB caches to be reset when a ZODB
>    connection is opened the next time.

Yes, but these objects are recreated when the module is reloaded. And if the
module who import stuff from this module in turn is reloaded, it's imports
to stuff in that module will be refreshed to point to the new objects.

And this works *most* of the time. :-) I have yet still to figure out
exactly when it doesn't.





More information about the Zope-Dev mailing list