diff --git a/src/common/helpers.py b/src/common/helpers.py index 0be1163f6..8c58f4491 100644 --- a/src/common/helpers.py +++ b/src/common/helpers.py @@ -170,6 +170,11 @@ def prep(user, server, resource): else: return server +def windowsify(s): + if os.name == 'nt': + return s.capitalize() + return s + def temp_failure_retry(func, *args, **kwargs): while True: try: diff --git a/src/groupchat_control.py b/src/groupchat_control.py index 4cecf8c97..fa8aacb1c 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -1271,8 +1271,10 @@ class GroupchatControl(ChatControlBase, GroupChatCommands): os.path.join(path, puny_new_nick + ext) for old_file in files: if os.path.exists(old_file) and old_file != files[old_file]: - if os.path.exists(files[old_file]): - # Windows require this + if os.path.exists(files[old_file]) and helpers.windowsify( + old_file) != helpers.windowsify(files[old_file]): + # Windows require this, but os.remove('test') will also + # remove 'TEST' os.remove(files[old_file]) os.rename(old_file, files[old_file]) self.print_conversation(s, 'info', tim)