windows require to remove old_file before doing os.rename(new_file, old_file)

This commit is contained in:
Yann Leboulanger 2007-01-05 18:05:51 +00:00
parent 759ddff650
commit d84b63b172
1 changed files with 3 additions and 0 deletions

View File

@ -878,6 +878,9 @@ class GroupchatControl(ChatControlBase):
os.path.join(path, puny_new_nick + ext) os.path.join(path, puny_new_nick + ext)
for old_file in files: for old_file in files:
if os.path.exists(old_file): if os.path.exists(old_file):
if os.path.exists(files[old_file]):
# Windows require this
os.remove(files[old_file])
os.rename(old_file, files[old_file]) os.rename(old_file, files[old_file])
self.print_conversation(s, 'info') self.print_conversation(s, 'info')