It's awhile that I'm struggling with a strange behavior of my code on different platforms.
My program is a GUI to a sqlite db that uses PyQt4 API's to access it. In different situations it looks like it is working correctly (no error, coherent db management at run-time) but when it ends no db modification is written to disk (and I find a db-journal nearby my db file). At the beginning I noticed that it worked onto some platforms and it didn't on others [ http://www.mail-archive.com/[email protected]/msg14774.html ]. Then I found which was the part of code responsible for the wrong behavior [ http://www.mail-archive.com/[email protected]/msg14883.html ]. After avoiding the use of lambda forms, and proceeding in my code development, I found an other statement that produced exactly the same problem: it was a simple reference to an owner object. I will explain it. 1- when my application starts it instantiates a MainWindow object 2- in its __init__ it instantiates many QtGui.QTableView objects 3- in their __init__ they instantiate one QtSql.QSqlQueryModel object each => If I pass through all this chain a reference to the mainWindow object (as init parameter) and I use it just in the subsequent. init-functions, every thing works fine. => If I store this reference in a queryModel object attribute, for subsequent. uses, every thing LOOKS LIKE it's functioning correctly, I don't get any error, but at the end of the execution all sqlite modifications are NOT written to disk and I find a db-journal file near by my db file. Note that it's enough that I store the reference to the mainWindow object, it doesn't matter if I don't or do use it. I was able to bypass this problem using a weakref.ref(mainW) instead of a plain reference Does this make any sense to you or it is a bug? I hope to receive a followup to my question even if I didn't to the previous ones (perhaps my English is too bad and no one can understand it ???) ciao Licia
_______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
