From bd009f3e833cf3a59ca9b0b3b3c4f8481ee2a2dd Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 17 Nov 2013 08:50:05 +0530 Subject: [PATCH] Include full path in error message when failling to read cover --- src/calibre/db/backend.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/calibre/db/backend.py b/src/calibre/db/backend.py index 259297ab20..45ea9b05a4 100644 --- a/src/calibre/db/backend.py +++ b/src/calibre/db/backend.py @@ -1234,7 +1234,12 @@ class DB(object): f = lopen(path, 'rb') except (IOError, OSError): time.sleep(0.2) - f = lopen(path, 'rb') + try: + 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: if hasattr(dest, 'write'): shutil.copyfileobj(f, dest)