mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Handle non-UTF-8 filenames in cache directory when expiring
This commit is contained in:
parent
428957543c
commit
d57626c043
@ -55,7 +55,10 @@ def robust_rmtree(x):
|
|||||||
retries = 2 if iswindows else 1 # retry on windows to get around the idiotic mandatory file locking
|
retries = 2 if iswindows else 1 # retry on windows to get around the idiotic mandatory file locking
|
||||||
for i in range(retries):
|
for i in range(retries):
|
||||||
try:
|
try:
|
||||||
rmtree(x)
|
try:
|
||||||
|
rmtree(x)
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
rmtree(as_bytes(x))
|
||||||
return True
|
return True
|
||||||
except EnvironmentError:
|
except EnvironmentError:
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user