[ZODB-Dev] Revisiting the ConflictError patch

Greg Ward gward@mems-exchange.org
Thu, 20 Sep 2001 16:08:46 -0400


More details on this coredump problem.  No need for my big patch to
POSException.py; if I make this change:

--- ZODB/POSException.py        12 Apr 2001 20:47:00 -0000      1.7
+++ ZODB/POSException.py        20 Sep 2001 20:05:20 -0000
@@ -107,2 +107,5 @@
 
+    def __init__ (self, message):
+        self.args = (message,)
+
 class VersionError(POSError):

then that's enough to make Python dump core while running the test.
That is the *only* difference relative to the current CVS of
StandaloneZODB.  If I remove that patch, and build/test the current CVS,
everything works fine.

If I change the patch to an *exact* emulation of what a vanilla
Exception's __init__ does:

--- ZODB/POSException.py        12 Apr 2001 20:47:00 -0000      1.7
+++ ZODB/POSException.py        20 Sep 2001 20:06:44 -0000
@@ -107,2 +107,5 @@
 
+    def __init__ (self, *args):
+        self.args = args
+
 class VersionError(POSError):

then it works fine.  It's only when I change __init__ from taking any
number of args to taking exactly two args (counting self) that it starts
dumping core.

Is it somewhere implicitly carved in stone that constructors of
exception classes must take an arbitrary number of arguments?

All very confusing...

        Greg