Hi,
I'm using IronPython 2.6 final.
When deriving from Exception class, and creating a constructor with a
different signature (not 1 argument), I get an exception when pickling and
unpickling.
Seems like the pickling process "neglects" some of the information so the
unpickling fails.
This can be reproduced with:
>>> class my_exc(Exception):
... def __init__(self, message, param):
... super(my_exc, self).__init__(message)
... self.param = param
...
>>> e = my_exc('message','param')
>>> import pickle
>>> pickle.loads(pickle.dumps(e))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Systems\3rd_party\IronPython\2.6\Lib\pickle.py", line 1374, in
loads
File "C:\Systems\3rd_party\IronPython\2.6\Lib\pickle.py", line 858, in
load
File "C:\Systems\3rd_party\IronPython\2.6\Lib\pickle.py", line 1133, in
load_reduce
TypeError: __init__() takes exactly 3 arguments (2 given)
Thanks.
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com