diff --git a/src/calibre/gui2/actions/delete.py b/src/calibre/gui2/actions/delete.py index a22461cf03..dab8cf3dae 100644 --- a/src/calibre/gui2/actions/delete.py +++ b/src/calibre/gui2/actions/delete.py @@ -5,7 +5,7 @@ __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal ' __docformat__ = 'restructuredtext en' -import errno +import errno, os from functools import partial from collections import Counter @@ -379,12 +379,12 @@ class DeleteAction(InterfaceAction): except IOError as err: if err.errno == errno.EACCES: import traceback - fname = getattr(err, 'filename', 'file') or 'file' + fname = os.path.basename(getattr(err, 'filename', 'file') or 'file') return error_dialog(self.gui, _('Permission denied'), _('Could not access %s. Is it being used by another' ' program? Click "Show details" for more information.')%fname, det_msg=traceback.format_exc(), show=True) - + raise self.library_ids_deleted2(to_delete_ids, next_id=next_id) else: self.__md = MultiDeleter(self.gui, to_delete_ids,