Make makefolder use same temporary name as folder/LocalStatus/save
This commit is contained in:
parent
aaf9478535
commit
d6f4a8dab8
@ -39,9 +39,13 @@ class LocalStatusRepository(BaseRepository):
|
|||||||
|
|
||||||
def makefolder(self, foldername):
|
def makefolder(self, foldername):
|
||||||
# "touch" the file, truncating it.
|
# "touch" the file, truncating it.
|
||||||
file = open(self.getfolderfilename(foldername), "wb")
|
filename = self.getfolderfilename(foldername)
|
||||||
|
file = open(filename + ".tmp", "wb")
|
||||||
file.write(offlineimap.folder.LocalStatus.magicline + '\n')
|
file.write(offlineimap.folder.LocalStatus.magicline + '\n')
|
||||||
file.close()
|
file.close()
|
||||||
|
os.unlink(filename)
|
||||||
|
os.rename(filename + ".tmp", filename)
|
||||||
|
|
||||||
# Invalidate the cache.
|
# Invalidate the cache.
|
||||||
self.folders = None
|
self.folders = None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user