PythonWin 2.1 saving bugg???
Neil Hodgson
nhodgson at bigpond.net.au
Wed Oct 31 07:01:22 EST 2001
Tim Gahnström:
> What I dont understand is, how can this happen? is this how the pythonwin
> savingfunction works?
>
> remove_old__file_from_disk
> Save new_file_that_current_spot
What it does is, with error checking removed:
os.unlink(bakFileName)
os.rename(fileName, bakFileName)
self.SaveFile(fileName)
The actual code is in Pythonwin\pywin\scintilla\document.py.
> BTW is this what openSource is about? If I look over the saving
> routines in PythonWin and find that they can be done better and
> fix it, is there a good chanse that, that will be incorporated into
> the next release?
If it is unambiguously better then I'm sure Mark will accept a patch.
However, he often has a good idea what he is doing so you may need to
discuss it with him in detail.
I noticed that you wrote:
> But after (abruptly and with scandisk...) having restarted
> the computer I came back and found that my program
> wasn't ther at all! anymore.
Does this mean you pressed the reset button (or similar) in an attempt to
keep the old file? If so this is a really bad idea as you have a good chance
of not having any of the copies survive as the on-disk data associated both
with the old and new copies may be incomplete.
Neil
More information about the Python-list
mailing list