[qmtest] Problem loading expectation
Vladimir Prus
ghost at cs.msu.su
Tue Jul 15 05:36:27 UTC 2003
Vladimir Prus wrote:
> > I have no idea what caused that error, but I did find a stupid bug
> > that prevented old-style file loading from working right. Attached is
> > the patch I've just committed to CVS, and you can see if it fixes your
> > problem...
>
> No luck. I get the following:
>
> Traceback (most recent call last):
> File "/home/ghost/build/Tools/qm-up-to-date/qm/test/qmtest.py", line 110,
[....]
> version = self.__unpickler.load()
> cPickle.UnpicklingError: <class 'qm.test.context.Context'> is not safe for
> unpickling
FWIW, I've worked this around and successfully loaded the expectation file
after making the following change:
--- qm/test/context.py 10 Jul 2003 00:33:02 -0000 1.11
+++ qm/test/context.py 15 Jul 2003 05:32:13 -0000
@@ -66,6 +66,9 @@
temporary directory at the same time. There is no guarantee that
the temporary directory is empty, however; it may contain files
left behind by the execution of other 'Runnable' objects."""
+
+ __safe_for_unpickling__ = 1
+
def __init__(self, context = None):
"""Construct a new context.
OTOH, I have no idea
- why it's necessary
- why Result class is readed OK, but Context is not.
Can anybody shed any light on this?
- Volodya
More information about the qmtest
mailing list