Hey all,<br>
<br>
I wanted to make a really simple save/load procedure for my Qt
application. I was hoping I could use pickle to capture the state
of my whole class and write it out, but whenever I try this I get a seg
fault in sip. I'll show the backtrace and some of the code
below. This is my first try so any pointers (no pun intended)
would be appreciated.<br>
<br>
------------------------------------------CODE<br>
from qt import *<br>
from dasrtconfig import *<br>
import sys<br>
from os import path<br>
import pickle<br>
<br>
class DasrtFunc(DASRTConfigForm):<br>
def __init__(self, *args):<br>
apply(DASRTConfigForm.__init__, (self, ) + args) #call Form2 init and pass args<br>
<br>
def saveConfig(self):<br>
outfile = file("out.txt", "w")<br>
pickle.dump(self, outfile)<br>
outfile.close()<br>
<br>
if __name__ == "__main__":<br>
app = QApplication(sys.argv)<br>
f = DasrtFunc()<br>
f.show()<br>
app.setMainWidget(f)<br>
app.exec_loop()<br>
<br>
---------------------------------------BackTrace<br>
#0 0x001e9ffc in initsip () from /usr/lib/python2.4/site-packages/sip.so<br>
#1 0x00393f6f in PyType_IsSubtype () from /usr/lib/libpython2.4.so.1.0<br>
#2 0x0035d3b4 in PyObject_Call () from /usr/lib/libpython2.4.so.1.0<br>
#3 0x003babde in PyEval_EvalFrame () from /usr/lib/libpython2.4.so.1.0<br>
#4 0x003bcef8 in PyEval_EvalCodeEx () from /usr/lib/libpython2.4.so.1.0<br>
#5 0x00371be1 in PyFunction_SetClosure () from /usr/lib/libpython2.4.so.1.0<br>
#6 0x0035d3b4 in PyObject_Call () from /usr/lib/libpython2.4.so.1.0<br>
#7 0x003b61c0 in PyEval_CallObjectWithKeywords ()<br>
from /usr/lib/libpython2.4.so.1.0<br>
#8 0x003d7901 in PyEval_CallMethod () from /usr/lib/libpython2.4.so.1.0<br>
#9 0x00396093 in _PyType_Lookup () from /usr/lib/libpython2.4.so.1.0<br>
#10 0x003831f3 in PyCFunction_Call () from /usr/lib/libpython2.4.so.1.0<br>
#11 0x003bc092 in PyEval_EvalFrame () from /usr/lib/libpython2.4.so.1.0<br>
#12 0x003bb7e4 in PyEval_EvalFrame () from /usr/lib/libpython2.4.so.1.0<br>
#13 0x003bb7e4 in PyEval_EvalFrame () from /usr/lib/libpython2.4.so.1.0<br>
#14 0x003bcef8 in PyEval_EvalCodeEx () from /usr/lib/libpython2.4.so.1.0<br>
#15 0x003bb69c in PyEval_EvalFrame () from /usr/lib/libpython2.4.so.1.0<br>
#16 0x003bcef8 in PyEval_EvalCodeEx () from /usr/lib/libpython2.4.so.1.0<br>
#17 0x00371be1 in PyFunction_SetClosure () from /usr/lib/libpython2.4.so.1.0<br>
#18 0x0035d3b4 in PyObject_Call () from /usr/lib/libpython2.4.so.1.0<br>
#19 0x00364c76 in PyMethod_Fini () from /usr/lib/libpython2.4.so.1.0<br>
#20 0x0035d3b4 in PyObject_Call () from /usr/lib/libpython2.4.so.1.0<br>
#21 0x003b61c0 in PyEval_CallObjectWithKeywords ()<br>
<br>