mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-03-04 17:26:56 +01:00
Handle non-UTF-8 filenames in cache directory when expiring
This commit is contained in:
parent
428957543c
commit
d57626c043
1 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
for i in range(retries):
|
||||
try:
|
||||
rmtree(x)
|
||||
try:
|
||||
rmtree(x)
|
||||
except UnicodeDecodeError:
|
||||
rmtree(as_bytes(x))
|
||||
return True
|
||||
except EnvironmentError:
|
||||
time.sleep(0.1)
|
||||
|
|
|
|||
Loading…
Reference in a new issue