From 7ef3d4f3fac985074840dd636220e1c036eb254a Mon Sep 17 00:00:00 2001 From: flan Date: Tue, 16 Apr 2019 19:50:27 +0200 Subject: [PATCH] Fix full sync on Windows From : > On Windows, if dst already exists, OSError will be raised even if > it is a file. ... > If you want cross-platform overwriting of the destination, use > replace(). Thanks to kerry liu (https://github.com/hqzxjczx) for reporting this. Fixes #32. --- ankisyncd/full_sync.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ankisyncd/full_sync.py b/ankisyncd/full_sync.py index c43a8a8..9044abd 100644 --- a/ankisyncd/full_sync.py +++ b/ankisyncd/full_sync.py @@ -25,7 +25,7 @@ class FullSyncManager: # Overwrite existing db. col.close() try: - os.rename(temp_db_path, session.get_collection_path()) + os.replace(temp_db_path, session.get_collection_path()) finally: col.reopen() col.load()