mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Try a copy+remove instead of a rename to get a better idea of what is causing access denied errors when restoring database for some people on windows
This commit is contained in:
parent
8e864305f3
commit
2729414b53
@ -271,12 +271,8 @@ class Restore(Thread):
|
||||
os.remove(save_path)
|
||||
try:
|
||||
os.rename(dbpath, save_path)
|
||||
except OSError as err:
|
||||
if getattr(err, 'winerror', None) == 32: # ERROR_SHARING_VIOLATION
|
||||
time.sleep(30) # Wait a little for dropbox or the antivirus or whatever to release the file
|
||||
os.rename(dbpath, save_path)
|
||||
else:
|
||||
raise
|
||||
except EnvironmentError:
|
||||
time.sleep(30) # Wait a little for dropbox or the antivirus or whatever to release the file
|
||||
shutil.copyfile(dbpath, save_path)
|
||||
os.remove(dbpath)
|
||||
shutil.copyfile(ndbpath, dbpath)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user