I had a weird experience over the last day or so. Since I converted my PyScenario application to work with another version of the parent mod (basically a mod-mod) one class object couldn't be pickled anymore. The exception complained over pickling an instance method and as I had no idea what that was, I researched the topic as good as I could. Even if was a little unsure about what it actually was I at least knew that I had no instance methods part in my program, but somehow the pickling application was identifying some method as part of an instance rather than a class, or something.
I believe that I managed to pinpoint the actual method and it has been unchanged during several months of beta testing, so it was the least likely suspect. It turned out to be a method I basically used for adding a class instance to a list. (That list is part of another class, of which an instance is stored in a list in yet another class instance, which in turn is stored in a list in an instance. So its basically a whole lot of instances with list attributes.)
I tried everything imaginable, basically reverting all changes in anyway connected to this particular issue, but it was still registering as a instance method. And even more strangely - only when the pickling was caused by onPreSave the first time initiated by onGameStart. The solution was to simply skip the method and assign the object directly to the list with the append() method.
Any ideas on how such a thing could occur? If anyone is interested I could post some code, but as I said - there are layers of stuff happening so it would be pretty hairy.
I believe that I managed to pinpoint the actual method and it has been unchanged during several months of beta testing, so it was the least likely suspect. It turned out to be a method I basically used for adding a class instance to a list. (That list is part of another class, of which an instance is stored in a list in yet another class instance, which in turn is stored in a list in an instance. So its basically a whole lot of instances with list attributes.)
I tried everything imaginable, basically reverting all changes in anyway connected to this particular issue, but it was still registering as a instance method. And even more strangely - only when the pickling was caused by onPreSave the first time initiated by onGameStart. The solution was to simply skip the method and assign the object directly to the list with the append() method.
Any ideas on how such a thing could occur? If anyone is interested I could post some code, but as I said - there are layers of stuff happening so it would be pretty hairy.