Rev 2873 fixes what I believe would have been a show-stopper.  In some
cases on Windows 7 I have been getting the following message:

exception renaming c:\leo.repo\trunk\leo\test\unitTest.leo to\
c:\users\edream~1\appdata\local\temp\tmppxbg_b
WindowsError: [Error 32] The process cannot access the file because it
is being used by another process: 'c:\\leo.repo\\trunk\\leo\\test\
\unitTest.leo'

Probably this is caused by several related *old* blunders uncovered by
Leo's new mkstemp code for creating backup .leo files.  In particular,
g.utils_rename had some very dubious code in it.  That code could
easily have lead to race conditions in the os.

What I did:

- fc.createBackupFile now calls shutils.move directly, avoiding
g.utils_rename which does way too much: it calls
g.makeAllNonExistentDirectories(!!)

- Simplified g.utils_rename.  We can now assume shutils exists.

- Removed an unwise call to g.utils_remove in g.utils_rename. This
could cause havoc with the following call to shutils_move!!

I had to fix this bug.  I hope I have done so, but attempting to
verify that race conditions are no longer possible is no easy task.
OTOH, the new code is substantially simpler than the old, so there is
hope.

Please report any instance of the following message immediately.  We
can not release rc1 (or even a beta release) while this is happening:

"The process cannot access the file because it is being used by
another process."

Edward

P.S. The g.utils_rename and g.utils_remove methods are legacies of the
bad old days when there were no platform-and-python-version
independent ways of moving and deleting files.  Now there is: shutils.

P.P.S. It is distressing to me that g.rename calls
g.makeAllNonExistentDirectories.  That is extremely poor design, imo,
because it is unexpected.  However, I'm not going to touch the code
until after Leo 4.7 final: it's too risky to do at this late date.

EKR

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to