Original Post
So I'm trying to update my save-game function, and as I found out a month or so ago, Python's Pickler can't handle PyGame's Surface objects. So this is no problem, I have a valid workaround. Problem is, today I tried running the save method, and it tells me there are Surface objects lying around I haven't prepared for pickling. I don't get this; I've been careful when adding new Surface objects, I think, to make sure the saving code included preparing them. So I now have a main file with over 1200 lines of code, and about 8 modules in addition to the main file, that I need to comb through to find any and all Surface objects. Thing is, Surface object's aren't always marked as such in the code (in mine, they almost never are), so I need to find them some other way than a simple textual search (I tried that with the things that do mark Surface objects anyway, and it didn't give me any clues).
My first instinct was, rather than pickling the whole game, I would pickle individual instances one at a time, to see where the error pops up. This hasn't yielded much, however, as the pickling seems to think there are Surface objects everywhere. Part of this, I thought, might be because each instance of stuff like items, projectiles, etc. have variables referencing the game, which contains everything; but I neutralized these variables, and the error still pops up.
So I'm at a loss as to how to figure out where the Surface objects are. Does anyone know any tricks for locating certain kinds of objects in the code, besides being careful in the first place?
My first instinct was, rather than pickling the whole game, I would pickle individual instances one at a time, to see where the error pops up. This hasn't yielded much, however, as the pickling seems to think there are Surface objects everywhere. Part of this, I thought, might be because each instance of stuff like items, projectiles, etc. have variables referencing the game, which contains everything; but I neutralized these variables, and the error still pops up.
So I'm at a loss as to how to figure out where the Surface objects are. Does anyone know any tricks for locating certain kinds of objects in the code, besides being careful in the first place?