Boy, this is like 30% bug report and 70% feature request. The feature request is to give DrPython some kind of session file knowledge so when a file (loaded from a session) is saved, it will automatically (or perhaps prompt) to save a new session file.
The bug report is that if you save a change to the py which modify's the folding state hierarchy, then later close and try to reload the session file, two things happen.
1) You get the something went wrong message - this is fine.
2) It loads the py but the file is broken - this is not okay.
As for 2, I'd say it should either load nothing at all (ie close the aborted loading) or load the file cleanly with no state (or some state if possible).
For instance, I added an:
in the middle of a bunch of other foldings in a file. Upon trying to open this modified py with the old dsf, the file is broken such that I see this:
[+ means expand, - means collapse, _ means block end tick mark]
651 - if foo:
652 _ bar
752 _ break
Anyway, the point is that lines 653 - 751 are missing and there is no expander to make them show up.
Let me know if you need me to pear down my py and dsf files to a small test-case.