mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2371 (error 32 while removing books from calibre-reproducible)
This commit is contained in:
parent
0884de147b
commit
ad62a99f13
@ -760,9 +760,9 @@ class LibraryDatabase2(LibraryDatabase):
|
|||||||
path = os.path.join(self.library_path, self.path(id, index_is_id=True))
|
path = os.path.join(self.library_path, self.path(id, index_is_id=True))
|
||||||
self.data.remove(id)
|
self.data.remove(id)
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
if iswindows:
|
try:
|
||||||
winshell.delete_file(path, no_confirm=True, silent=True)
|
winshell.delete_file(path, no_confirm=True, silent=True)
|
||||||
else:
|
except:
|
||||||
self.rmtree(path)
|
self.rmtree(path)
|
||||||
parent = os.path.dirname(path)
|
parent = os.path.dirname(path)
|
||||||
if len(os.listdir(parent)) == 0:
|
if len(os.listdir(parent)) == 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user