[Zope] Warning: don't refresh MonkeyPatches
Sat, 22 Mar 2003 22:24:00 +0100
Paul Winkler wrote at 2003-3-21 12:47 -0500:
> 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...
This is not a problem of monkey patching, but of refreshing
Search the mailing list archives: Shane explains in some
message why it happens and how to avoid it.