[Zope] Warning: don't refresh MonkeyPatches
Stefan H. Holek
Fri, 21 Mar 2003 19:04:48 +0100
As an extra precaution you could explicitly disallow a refresh by setting
__refresh_module__ =3D 0
in your monkey patch module.
--On Freitag, 21. M=E4rz 2003 12:47 -0500 Paul Winkler =
> Posting this on the off chance that it saves someone the week
> of hair-tearing that I've just experienced...
> I sometimes find MonkeyPatches a convenient way to globally change
> behavior of zope or 3rd-party products. But I just discovered
> something very important:
> it's apparently NOT safe to "refresh" a MonkeyPatch-style product.
> I have a monkeypatch that works fine until I refresh it, then I get
> mysterious errors like "Object of type 'None' is not callable" with no
> indication in the traceback of what object is None or even what's
> trying to call it!
> In a debugging session, I explored everything near the end of the
> traceback and could not find any variables that are None. I know
> it's in there somewhere...
> If I restart zope, everything works fine.
Those who write software only for pay should go hurt some other field.