Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make makefolder use same temporary name as folder/LocalStatus/save

  • Loading branch information...
commit d6f4a8dab86754b05fa2bcb216dcb9716e111e52 1 parent aaf9478
@jgoerzen jgoerzen authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 offlineimap/repository/LocalStatus.py
View
6 offlineimap/repository/LocalStatus.py
@@ -39,9 +39,13 @@ def getfolderfilename(self, foldername):
def makefolder(self, foldername):
# "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.close()
+ os.unlink(filename)
+ os.rename(filename + ".tmp", filename)
+
# Invalidate the cache.
self.folders = None
Please sign in to comment.
Something went wrong with that request. Please try again.