mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Include full path in error message when failling to read cover
This commit is contained in:
parent
c6fda62cc7
commit
bd009f3e83
@ -1234,7 +1234,12 @@ class DB(object):
|
|||||||
f = lopen(path, 'rb')
|
f = lopen(path, 'rb')
|
||||||
except (IOError, OSError):
|
except (IOError, OSError):
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
|
try:
|
||||||
f = lopen(path, 'rb')
|
f = lopen(path, 'rb')
|
||||||
|
except (IOError, OSError) as e:
|
||||||
|
# Ensure the path that caused this error is reported
|
||||||
|
raise Exception('Failed to open %r with error: %s' % (path, e))
|
||||||
|
|
||||||
with f:
|
with f:
|
||||||
if hasattr(dest, 'write'):
|
if hasattr(dest, 'write'):
|
||||||
shutil.copyfileobj(f, dest)
|
shutil.copyfileobj(f, dest)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user