[Zope-dev] zpatterns-0.4.0a5: problem with unregistering transactionals

Jephte CLAIN Jephte.Clain@univ-reunion.fr
Wed, 26 Jul 2000 11:22:54 +0400


hello,

I have a case where Transactional._unregister is called without
Transactional._register being called, raising an exception in
Transaction._unregister and then in
ZODB.Transaction.Transaction.__del__, causing Zope to dump core when it
is run as a daemon (because python notifies of the unhandled exception
by writin to stderr)

I have not yet found why (and how?) an object is
Transactional._unregistered without being Transactional._registered
before. (I even did not know about the existence of these methods!) But
until I understand, this patch allow me to stay alive:

--- Transactions.py.orig        Thu Jul 20 09:58:00 2000
+++ Transactions.py     Wed Jul 26 11:12:25 2000
@@ -45,7 +45,8 @@
         self._v_registered = 1
 
     def _unregister(self):
-        del self._v_registered
+        try: del self._v_registered
+        except: pass
 
 
     # From here down, override as you see fit...

more to come when I have the time to figure out the problem. it might be
a bug in zpatterns :-)

regards,
jephte.clain@univ-reunion.fr