Unify LocalStatus.py repository code with folder code

refs #63
This commit is contained in:
John Goerzen 2008-04-17 00:09:11 -05:00
parent 6fd4962b4c
commit c046383dc2

View File

@ -40,13 +40,11 @@ class LocalStatusRepository(BaseRepository):
def makefolder(self, foldername):
# "touch" the file, truncating it.
filename = self.getfolderfilename(foldername)
file = open(filename + ".tmp", "wb")
file = open(filename + ".tmp", "wt")
file.write(offlineimap.folder.LocalStatus.magicline + '\n')
file.flush()
os.fsync(file.fileno())
file.close()
try:
os.unlink(filename)
except:
pass
os.rename(filename + ".tmp", filename)
# Invalidate the cache.