diff --git a/client.py b/client.py index 5ac4e01..86f77f0 100755 --- a/client.py +++ b/client.py @@ -204,7 +204,13 @@ class MunyalClient(Icon): f.write(base64.b85decode(data["file"].encode("ascii"))) os.rename(temp_dir, full_path) else: - os.remove(full_path) + while True: + try: + os.remove(full_path) + break + except: + print("Maybe the file is open, please close first") + sleep(5) else: if data["action"] == "add": os.mkdir(full_path)