config: Replace the config file with its new version, rather than copy2/remove.

This commit is contained in:
Emmanuel Gil Peyrot 2018-07-08 10:56:45 +02:00
parent 1707b14691
commit b3a944c76b

View file

@ -349,8 +349,7 @@ class Config(RawConfigParser):
encoding='utf-8') as fd: encoding='utf-8') as fd:
for line in lines: for line in lines:
fd.write('%s\n' % line) fd.write('%s\n' % line)
copy2(filename, self.file_name) filename.replace(self.file_name)
remove(filename)
except: except:
success = False success = False
log.error('Unable to save the config file.', exc_info=True) log.error('Unable to save the config file.', exc_info=True)